Surviving on OS X when you're used to the terminal

If you’ve spent some portion of your life with Linux on your computer, you’ve undoubtably discovered the usefulness of the Linux command line. Sometimes it’s just quicker to get something done by pulling up a terminal and entering a one-liner.

The GNOME file manager makes it trivial to open a terminal at your current location, if you have the nautilus-open-terminal package installed:

Going the other way around, from terminal to GUI is also easy:

  • Open current folder in file manager: nautilus .
  • Open any file with default application: gnome-open myfile.xyz

If you’ve grown into this habit, you’ll feel lost whenever you need to use a Mac. No such option in the file manager and no gnome-open command (obviously).

Don’t worry though, it’s all possible. Here’s how.

Opening a terminal at the current folder
Opening a terminal at the current folder requires you to make a small change to the preferences. Open the keyboard preferences, go to services (on the keyboard preferences page) and enable the two services shown below:

Once you’ve done that, you can simply right-click any folder and find the option under the services menu:

Opening any file from the file manager
Need to open an image from the command-line? Or a PDF? Or any other document. Simply use open: open myfile.xyz

To open a finder window and show the file in the file manager, use the -R (reveal) flag: open -R .

At least now you can switch back and forth between command-line and GUI quickly. Try Homebrew if you need to install your favorite missing tools.

Posted: September 18, 2011 16:51 Tags: gnome linux mac osx

Comments