I really like that cd
command. :P
It’s six letters. Can’t they just call it zd
or something? Yeah sure, I can use aliases, but why complicate in the first place?
Hm I wonder, is it really a command? I thought it is just a function of the shell to change the working directory.
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.
Since nobody has said yet, I use screen pretty heavily. Want to run a long running task, starting it from your phone? Run screen to create a detachable session then the long running command. You can then safely close out of your terminal or detach with ctrl a, d and continue in your terminal doing something else. screen -r to get back to it.
I recently switched to tmux and boy, it’s way better. I basically use only tmux now anymore. Creating panes to have two processes in one glance, multiple windows, awesome. Plus all the benefits of screen.
pushd and popd to change directory and go back when done there.
cd -
undoes the last cd. Not quite push/popd but still useful. Pro tip, works also: git checkout -
Hell yeah. Every one of these threads makes me more inclined to read man pages
sudo udevadm monitor
Figuring out which usb device went on holiday.