Tuesday, January 24, 2012

Ultra cool commands

I planned to make a good cheat sheet from http://www.reddit.com/r/linux/comments/mi80x/give_me_that_one_command_you_wish_you_knew_years/,
well, here are some..., i'll keep updating this when I am bored..
  • units - conversion between more than 2000 kinds of units (kg to pounds, kilometers to miles etc.)
  • ctrl + e - opens current command in $EDITOR and runs the altered version
  • fc - similar to above, but opens previous command
  • ctrl + r - reverse searches what you've entered in command history
  • bind '"\e[A": history-search-backward' - binds your UP arrow key to only search whatever you've entered partially
  • bind '"\e[B": history-search-forward' - binds your DOWN arrow key to only search whatever you've entered partially
  •  lsof - ultra powerful so go here for detailed usage http://danielmiessler.com/study/lsof/
  • find . -print0 | xargs -0 command -Runs command on all the files found.
  • ctrl + a - Go to beginning of line
  • cd - - Go to previous working directory. The directory you were in, before cd ing to some other directory.
  • :w ! sudo tee %  - in vim when you forgot to open the file in sudo mode
  • pushd  - Pushes a directory to stack and cds there
  • popd - removes current directory from stack and cds to prevoius directory
  • tmux - read here http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
  • man -k searchstring - Search whether a tool is available for some task in your machine

No comments:

Post a Comment