Difference between revisions of "bash"
Athar Hameed (talk | contribs) |
Jason Parmer (talk | contribs) |
||
| Line 4: | Line 4: | ||
* ctrl-r (Reverse search in command history. Tab to complete command.) | * ctrl-r (Reverse search in command history. Tab to complete command.) | ||
* tab (Tries to complete what ever you have typed in.) | * tab (Tries to complete what ever you have typed in.) | ||
| − | * !$ | + | * !$ - last word of previous command. Handy for doing something with a file you just did something with |
| − | * !! | + | * !! - entire last command. Handy if you forget to sudo something, sudo !! will be faster then editing the old command |
==For Loops== | ==For Loops== | ||
for i in * ; do echo $i ; bzip2 $i ; done | for i in * ; do echo $i ; bzip2 $i ; done | ||
| − | |||
[[Category:ToolHowTo]] | [[Category:ToolHowTo]] | ||
Revision as of 19:40, 27 September 2007
Bash shell tricks
Shortcuts
- ctrl-r (Reverse search in command history. Tab to complete command.)
- tab (Tries to complete what ever you have typed in.)
- !$ - last word of previous command. Handy for doing something with a file you just did something with
- !! - entire last command. Handy if you forget to sudo something, sudo !! will be faster then editing the old command
For Loops
for i in * ; do echo $i ; bzip2 $i ; done
