5 Time Saving Bash Tricks<br />Nikhil Mungel                         @hyfather<br />
Fun with Control and Meta<br />
Meta-Dot and friends<br />scp ~/source/tree/file.cnikhilm@server.tw.com:.<br />M-.<br />nikhilm@server.tw.com:.<br />Yank ...
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...
Bang through the History!<br />!!<br />Substitute previous command.<br />$ sudo !!<br />
SSH multiplexing<br />http://bit.ly/bashtips<br />~/.ssh/config<br />Host *<br />ControlMaster auto<br />ControlPath /tmp/...
pushdand popd<br />A stack of directories!<br />$ pushd .<br />$ popd<br />
Multi-Session History<br />http://bit.ly/bashtips<br />~/.bashrc<br />$ shopt –s histappend<br />
tail -f httpd.log &<br />http://bit.ly/bashtips<br />Share STDOUTbetween the REPL and the tail.<br />Even the shell itself...
Thanks!<br />http://bit.ly/bashtips<br />Nikhil Mungel<br />@hyfather<br />
Upcoming SlideShare
Loading in...5
×

5 Time Saving Bash Tricks

8,414

Published on

Presented by Nikhil Mungel at DevOpsDays Bangalore 2011.

Published in: Technology, Education
3 Comments
6 Likes
Statistics
Notes
No Downloads
Views
Total Views
8,414
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
3
Likes
6
Embeds 0
No embeds

No notes for slide

5 Time Saving Bash Tricks

  1. 1. 5 Time Saving Bash Tricks<br />Nikhil Mungel @hyfather<br />
  2. 2. Fun with Control and Meta<br />
  3. 3. Meta-Dot and friends<br />scp ~/source/tree/file.cnikhilm@server.tw.com:.<br />M-.<br />nikhilm@server.tw.com:.<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. 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. 5. Bang through the History!<br />!!<br />Substitute previous command.<br />$ sudo !!<br />
  6. 6. SSH multiplexing<br />http://bit.ly/bashtips<br />~/.ssh/config<br />Host *<br />ControlMaster auto<br />ControlPath /tmp/%r0%h:%p<br />
  7. 7. pushdand popd<br />A stack of directories!<br />$ pushd .<br />$ popd<br />
  8. 8. Multi-Session History<br />http://bit.ly/bashtips<br />~/.bashrc<br />$ shopt –s histappend<br />
  9. 9. tail -f httpd.log &<br />http://bit.ly/bashtips<br />Share STDOUTbetween the REPL and the tail.<br />Even the shell itself is a REPL (!)<br />No switching tabs.<br />
  10. 10. Thanks!<br />http://bit.ly/bashtips<br />Nikhil Mungel<br />@hyfather<br />

×