- Arrow keys do what you'd expect
ctrl
+a
will put you at the beginning of the linectrl
+e
will put you at the endctrl
+w
deletes previous word (space delimited)tab
will auto-complete commands (requiresbash-completion
)ctrl
+l
forces a screen redrawctrl
+r
recursively searches through historyctrl
+c
stops
!!
- substitute in last command here!$
- place last argument of last command here./
- current directorycd
- change to home directorycd -
- Change to last directory^foo^bar
- Run last command replacing stringfoo
withbar
fc
- Open last command in$EDITOR
. Execute upon save+quitctrl
+x
;e
- Open current command line in$EDITOR
Replacement for cat
that shows file progress via stderr
Parallel gz. Compression sizes are similar if not same, but uses multiple cores
pigz -c ./ChessData.tar > ChessData.tar.pigz.gz
You can send the same input to multiple outputs without having to run multiple commands
pv ./ChessData.tar | tee >(gzip - > /tmp/ChessData.tar.gz) >(bzip2 - > /tmp/ChessData.tar.bz2) | xz - > /tmp/ChessData.tar.xz
Use flock to make a lock with a file. This helps with cron jobs
* * * * * /usr/bin/flock -w 0 /path/to/cron.lock /usr/bin/php /path/to/cron.php
Put a file into the clipboard
cat file.txt | xclip -selection clipboard -in
Put clipboard into file
xclip -selection clipboard -out > file.txt
Command Line Tools Can Be 235x Faster Than Your Hadoop Cluster