[Bradford] Intro to the command line

Steve Wilson steve at swsystem.co.uk
Sat Mar 28 16:16:04 UTC 2009


Philips notes prompted a couple more from me.

Following on from expanding ~/ to $HOME/

"cd" will take you to your home directory
"cd -" will take you to the previous directory, you can use pushd and 
popd but that's trickier to remember.

command history's great along with the crtl-R method of searching you 
can prefix with ! run the last command matching the start of the line
Imagine I'd previously used `ls -lart | grep ... | awk ...` just typing 
"!ls" would run that command again if it was the last  match starting 
with ls

Another big one which I find with people only just getting to grips with 
the command line is tab completion, I'm forever telling people to tab 
when they're doing things with long directory names, imagine:

vi /usr/local/apache2/conf/httpd.conf

this can probably be cut down to

vi[TAB]/us[TAB]loc[TAB]apa[TAB]con[TAB]htt[TAB]

Saving time on key strokes/error correction and/or spelling.

Regards

Steve
 



More information about the Bradford mailing list