Skip to content

Instantly share code, notes, and snippets.

@keeperofthenecklace
Created August 22, 2012 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keeperofthenecklace/3427477 to your computer and use it in GitHub Desktop.
Save keeperofthenecklace/3427477 to your computer and use it in GitHub Desktop.
Command line Shortcut
Esc shft + b - moves cursor(c) BACK to begin of a text. eg. (c)albert (c)mckeever (c)help
Esc shft+ f moves cursor(c) FORWARD to begin of a text. eg. (c)albert (c)mckeever (c)help
shft + cmd - selects all
Ctrl+A and Ctrl+E - home and end
Ctrl+U: This clears the entire line so you can type in a completely new command.
Ctrl+K: This deletes the line from the position of the cursor to the end of the line.
Ctrl+W: This deletes the word before the cursor only.
Ctrl+R: This lets you search your command history for something specific.
Tab: autocomplete
File Paths
-----------
$ Dragging Files from FINDER Into the Terminal Window => $albert/sites/project
$ cd .. moves you one folder up.
$ cd ../config moving in the directory will take you to the config dir from the app dir.
$ cd - This will move you back to your last working directory
$ cd move you to the home dir
$ !! to represent the last command you ran
$ !cat if you want to run the last command that used cat
$ !cat:p If you just want to see what the last cat command was, you can instead run:
Replacing
-------------
$ ^projact^projects - will replace your last command with the new string. so, cd Sites/projact/rails becomes Sites/projects/rails
History
-----------
$ history display all commands
$ history | grep Sites displays all history with Sites commands.
eg... 481 cd/Sites
482 cd/Sites/codes
$ !482 runs the command cd/Sites/codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment