One of the greatest strengths of Mac OS X, for developers in particular, is that it has a very elegant and consistent graphical user interface as well as an excellent command line interface. I’m not going to cover the basics like “ls” and “cd”, but rather point out some Mac OS X specific tools that are less well known than they should be.
Many of these are the command line equivalents for the GUI versions available in OS X. Combining them with other command line tools can be very powerful and huge time savers. See the “man” pages for more details of each.
open – Opens a file, application, or directory in GUI-land. Very useful.
screencapture – Take a screenshot. Exactly the same as
say – Text to speech. Give it a file name, string of text, or pipe the output of another program to it. Options for difference voices,
saving the result to a file, etc. Fun hobby: ssh into a computer being used by someone else and start speaking to them using “say”.
pbcopy and pbpaste – Copy and paste to/from the OS X pasteboard.
srm – Secure “rm”. Like “rm” but overwrites deleted data. “-m” gives you DoD compliant erasing!
osascript – Run AppleScripts (or other OSA languages) from the command line. (I use this in the “term” script)
hdiutil – create and open disk images (.dmg)
defaults – view and set various hidden settings. Check out macosxhints.com for some of these.