5 Essential Terminal Shortcuts for Beginners

Flatiron School / 22 October 2012

The following is a guest post by Rex Feng and originally appeared on his blog. Rex is currently a student a The Flatiron School. You can learn more about him here, or follow him on twitter here.

The first time you see the Terminal screen, it’s very intimidating. “What am I supposed to do here How do I navigate? What can I type?” Over time, cd-ing and ls-ing will become second nature. Using a Command Line Interface (Terminal) is simply more efficient than leaving the comfortable home position to drag the mouse a few inches.

In OS X, Terminal wraps the Bash (Unix shell) application. I’ve learned some essential Bash shortcuts that will help you save time and be more efficient.

  1. [Tab]Command-line completion is amazing. Bash will automatically fill in partially typed commands. If you have a file named “profile-page.html” and hit [Tab] while typing out the first few letters, the rest of the file name will likely be auto completed for you.
  2. ls -a
    While you probably know about typing ls in a directory to show all files, typing ls -awill let Bash show you all files (including the hidden ones) that Finder won’t show you by default.
  3. touch[file_name]The touch command takes in a file_name argument that is the file name created on the spot.
  4. [Cmd+T]Create tabs with [Cmd+T] Do you remember the first time you tried Firefox several years ago? Tabs are your friends.
  5. open [target]The open command followed by the folder or file name will let you open up files in their default application.

Working in the Terminal is amazing. If you’re interested in more power tips, I’d recommend reading about alias and subl symlink.

SQL Joins Explained Visually: The 3 Ring Binder Model Previous Post Modules as Mixins in Ruby Next Post