OSX Commands reference

The commands listed are used from within Terminal.

Open an application

To open an OSX application:

open -a textedit.app index.html

Create a RAM disk

To create a 50mb RAM disk, type the following:

hdid -nomount ram://52428800
$ 
newfs_hfs /dev/disk1
$ 
mkdir /tmp/ramdisk1
$ 
mount -t hfs /dev/disk1 /tmp/ramdisk1

To unmount and destroy the RAM disk:
hdiutil detach /dev/disk1

Screen captures

The command line offers a more advanced way to take screen captures.

Type the following to bring up a camera icon waiting to be clicked on a window. Once clicked, the named file is created:

screencapture -iW ~/Desktop/screen.jpg

You can snapshot the entire screen using:

screencapture -S ~/Desktop/screen.jpg

To capture a portion of your screen type:

screencapture -ic