Skip to content

Instantly share code, notes, and snippets.

@redesigned
Last active January 12, 2017 19:44
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 redesigned/7817413 to your computer and use it in GitHub Desktop.
Save redesigned/7817413 to your computer and use it in GitHub Desktop.
Terminal / Shell Shortcuts
pwd (personal working directory)
cd (change directory)
mkdir (make directory)
⌘k (clear screen)
clear (clear screen)
ls (list directory)
touch (set times or create files)
rm (remove)
all osx commands: http://ss64.com/osx/
htpasswd -nb username password
Tab: command completion
Up/Down Arrows: scroll through command history
Ctrl+Left and Ctrl+Right: jump forward and back through command arguments
Home and End (Ctrl+A and Ctrl+E): jump to beginning or end of command.
Ctrl+U: clears the entire line
Ctrl+K: clears from cursor to the end of the line
Ctrl+W: deletes the word before the cursor only
Ctrl+R: search your command history for something specific
!!: same as last comamnd (sudo !!)
$!: different command same arguments (mkdir /new/awesome/folder and cd $!)
history: history of run commands
history | grep XXXX: search history for command XXXX
!455: run command 455 from history of commands
sudo chown -R $(whoami) /usr/local (own a directory and subs)
Open Finder from Terminal
Current Directory: open ./
User Directory: open ~
Any Directory: open /System/Library
Open Terminal from Finder
Go2Shell http://zipzapmac.com/Go2Shell
find . -iname '._*' -exec rm -rf {} \;
find . -iname '.DS_Store' -exec rm -rf {} \;
-or-
find . -name '*.DS_Store' -type f -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment