From a tutorial somewhere...
sudo !!
: re-executing the last command assudo
.Ctrl + X + E
in the terminal to open an editor.- Create a super fast RAM disk (hard drive on the RAM):
Can get 5-200 times the HD speed.
mkdir -p /mnt/ram mount -t tmpfs /mnt/ram -o size=8192M
- In order to not put a command in the
history
, you can add a leading space to the comand (e.g.ls -l
). - If you wish to fix a really long command, you can open an editor with the last command with
fc
. - Quickly create folders with permutations:
The
mkdir -p folder/{sub1,sub2}/{sub1,sub2,sub3} # or mkdir -p folder/{1..100}/{1..100} # creates 10,000 folders
-p
is essential because it creates the parent folder if it doesn't exist when trying to create the child ones. - Intercept
stdout
and log to file (tee
):cat file | tee -a log | cat > /dev/null
- Exit a terminal but leave all processes running:
disown -a && exit # -a is for all the processes