I'm sure you're familiar with
sudo, which stands for superuser, do once. If not, you can see wikipedia. Normally you will use this to write (install) or even delete files in /usr/bin and the like. Don't forget to read the
man page on this one. There is always something interesting in the manual.Many Unix commands appear simple but have numerous options and arguments that make them more like a Swiss Army Knife than a pocketknife. Output on the command line using
man can be broken up into chunks or streamed using the down arrow, but maybe you want to study it or keep it as a reference. For some reason you need to format the output from
man in a special way before directing it to a file, for example:Nearly the whole alphabet! But doing this without the
col leads to selective stuttering:head and tail are useful for looking at the first few lines or last few lines of a file. less is like what you get when you just do man some_command ---it gives chunks or streams.Try
man cat to see what else that can do.There is also
split but I couldn't figure out how to make it take my favorite separator ('\n\n').diff does what you might expect. The use case might be that you have some good edits but also some bad edits to a file, so you want to revert to the old one, and then try the edits one by one. Or drop
results.txt onto TextMate for a little color (graphic).
There's a command to find out information about different processes with finer grained control than Activity Viewer. For example:
Say:
The
man page on ps is extensive.find is tricky. I need a lot more practice to understand it. Here's a simple one, and then a fun one though:I "find" all the files under my home directory and feed the results to
wc (word count), discovering that there are 118,791 lines in the output---that's the number of files! This link seems to have good info on find.Sometimes I just want to use Python as a calculator or get an ascii value, but without calling up the interpreter (and having to dismiss it):
Finally, here are a few more that either I've found useful or I'm sure they will be, but I don't feel expert enough to try to explain them. Have fun exploring:
If you get bored here; or try to check out how Greg's email address gets generated!
And there's always
ssh. But that really does deserve a post of its own.