Skip to content

Instantly share code, notes, and snippets.

@troyericg
Created January 31, 2013 19:47
Show Gist options
  • Save troyericg/4685790 to your computer and use it in GitHub Desktop.
Save troyericg/4685790 to your computer and use it in GitHub Desktop.
A quick list of OSX Terminal commands. For an A-Z index of the Apple OS X command line, I go to http://ss64.com/osx/
" cd " - Current Directory
" cd - " - Takes you to the last directory you were in
" . " Current Directory
".." Previous Directory
"~" Home Directory (But don't do it!)
" ~/ " Direct path to a directory
"less" - Displays a file (page by page)
"cat" - Displays a file (in full)
"open" - Opens files (including directories) in finder
"mate " Opens files in TextMate
Space - Scrolls (page-by-page)
" less " - Views files within your terminal
(Inside less) Ctrl+U/D - Scroll Up/Down
(Inside less) q - exits whichever file you're viewing
ls (list current directory) - Displays files inside of a directory
pwd (print working directory) - Tells you what directory you're currently in.
" man (Manual) + any command " - Gives directions for that command.
" say + (any word) - Computer speaks
" apropos + (keyword) " - Suggests commands (based on keyword)
" whatis + (command) " - Explains the command in question.
" touch + (filename) " - creates that file (empty).
" cp + (something) + (someplace) "
" mv + (something) + (someplace) " - Move
" rm " - Removes completely. Bypass the system's trashcan (DO NOT USE).
------------------------------------------------------------------------------------------------
INSIDE RAILS
"rake" - Task command
" rake -T " - Gives a list of all tasks in project (with description)
" rake routes " - List of URLs in a web browser (related to the project)
------------------------------------------------------------------------------------------------
TAB - As you type, pressing tab will try to complete the line (if there are multiple options, hit TAB twice to show the list of possible options). Also works with commands. (*Case-sensitive).
UP/DOWN ARROWS - Cycles through your typing history.
CTRL+R - Searches through your typing history.
CTRL+A - Jumps to beginning of a line.
Ctrl+C - Quit command/program.
CTRL+E - Jumps to the end of a line.
CTRL+K (Kill) - Clears a line.
\ (Backslash) - Tells computer to ignore the special character after it (interpret the next character literally, instead of as a special character).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment