Skip to content

Instantly share code, notes, and snippets.

@benlk
Last active August 29, 2015 14:28
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 benlk/ea37e9ba2dc1000f23b1 to your computer and use it in GitHub Desktop.
Save benlk/ea37e9ba2dc1000f23b1 to your computer and use it in GitHub Desktop.
# From https://twitter.com/addyosmani/status/633405466094120960
!! # run the last command executed
sudo !! # run the last command, but as root
!<word> # run the last command that started with the word
!<word>:p # List, but don't run that last command. :p is like "print"
<space>command # execute a command without saving it in history
echo "ls -l" | at midnight # execute command at a given time. `man at` has come really nice examples.
ls -lhS # sort files by sizes in directory
top -o vsize # why is your computer slow
# OSX-specific
qlmanage -p <file> # OSX QuickLook preview from the command line
caffeinate -u -t 3600 # stop your mac for sleeping for 1h
echo "foo" | pbcopy # add "foo" to the command-v clipboard for pasting
pbpaste > file.txt # dump the command-c/x clipboard to a file
open file.whatever # Open the file using OSX's normal program for that file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment