control+R
in bash, it lets you quickly search for previously executed commands.
its very useful and makes things much quicker, i recommend you give it a try.
CTR + u will delete the whole command. I use that a lot so I don’t have to backspace. It’s saved me a ton of time
pv (Pipe Viewer) is a command line tool to view verbose information about data streamed/piped through it. The data can be of any source like files, block devices, network streams etc. It shows the amount of data passed through, time running, progress bar, percentage and the estimated completion time.
sudo !!
to rerun last command as sudo.
history
can be paired with !5
to run the fifth command listed in history.
I believe it’s the fifth oldest - I think !-5
will get you the fifth impost recent, but I was shown that and haven’t put it into practice.
The most common usecase I do is something like history | grep docker
to find docker commands I’ve ran, then use !
followed by the number associated with the command I want to run in history.
ls