Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

5 Time Saving Bash Tricks


Published on

Presented by Nikhil Mungel at DevOpsDays Bangalore 2011.

Published in: Technology, Education

5 Time Saving Bash Tricks

  1. 5 Time Saving Bash Tricks<br />Nikhil Mungel @hyfather<br />
  2. Fun with Control and Meta<br />
  3. Meta-Dot and friends<br />scp ~/source/tree/<br />M-.<br /><br />Yank the last argument to previous command.<br />M-C-y<br />~/source/tree/file.c<br />Yank the first argument to previous command.<br />
  4. Killing and Yanking<br />C-k<br />Kill text till end-of-line.<br />C-y<br />Yanks it back!<br />M-y<br />Cycle through the kill-ring.<br />
  5. Bang through the History!<br />!!<br />Substitute previous command.<br />$ sudo !!<br />
  6. SSH multiplexing<br /><br />~/.ssh/config<br />Host *<br />ControlMaster auto<br />ControlPath /tmp/%r0%h:%p<br />
  7. pushdand popd<br />A stack of directories!<br />$ pushd .<br />$ popd<br />
  8. Multi-Session History<br /><br />~/.bashrc<br />$ shopt –s histappend<br />
  9. tail -f httpd.log &<br /><br />Share STDOUTbetween the REPL and the tail.<br />Even the shell itself is a REPL (!)<br />No switching tabs.<br />
  10. Thanks!<br /><br />Nikhil Mungel<br />@hyfather<br />