Cатсн²² (in)sесuяitу / ChrisJohnRiley

Because we're damned if we do, and we're damned if we don't!

Upgrade your Linux-Fu

I’ve recently re-discovered the wonderfully named shell-fu website. If you use Linux a lot then some of the tips and tricks here are going to certainly come in handy. Sure some of them are wild and wacky, some are even older than I am (don’t ask), still there’s some nice little tricks that every real Linux user should appreciate.

My favourite, which I’ve been using with great success over the past few months is the shortcut to run a follow-up command with the same arguments as your previous command. You can simply use !* to repeat all arguments from the previous command, or !:x where x is the argument number you want to repeat.  you can also use !! to repeat the whole command (useful if you need to sudo a command) An example is in order I think.

mkdir /etc/configuration/really_long_and_hard_to_remember_directory_name

cd !:1

This command will use the 1st argument (!1 is 1st argument)from the previous command line and add it to the cd command. Saves valuable seconds that you could be using surfing for lolats of browsing the FAIL blog 😉

Check out the site for some more great time saving hints…

Comments are closed.

%d bloggers like this: