If you're a complete beginner to UNIX (as I still consider myself), you can use something called aliases to save yourself a lot of typing at the command line.
In the Mac OS, an alias is simply a pointer to another file. In the UNIX world, an alias is similar in concept, except that it's a command that points at another command. There are a few pre-defined aliases in the tcsh shell (the program that runs when you open a terminal). You can see these by typing
aliasat the command line. One of the more useful pre-defined aliases is ll which replaces ls -lag for complete file listings.
You can easily define your own aliases in UNIX. Here's an example. When I connect to my home machine from work, I use the secure shell (SSH) built into OS X. However, to connect to the machine, I have to enter the following command (phony IP address listed, of course!):
ssh -l robg -p 7022 192.168.1.1This is obviously a bit of a pain. However, I can easily create an alias to do all the hard stuff:
alias hssh 'ssh -l robg -p 7022 192.168.1.1'Within that terminal session, whenever I type hssh, I'll connect to my home machine. To remove the alias, you use (logically enough) the unalias command:
unalias hsshHowever, if I close the window and open a new terminal session, the alias will be gone. Aliases entered at the command line are effective for that session only.
vi /Users/robg/.tcshrcEnter any aliases you'd like to use in the form of
alias aliasname 'command to be aliased'You only need to use the quotes if the command to be aliased contains spaces; separate aliases with a carriage return. So my sample .tcshrc file might look something like
alias hssh 'ssh -l robg -p 7022 192.168.1.1' ** My home machine **Obviously, don't enter the comments noted following the '**' in the examples above.
alias mssh 'ssh -l macosxhints 192.168.1.3' ** The MacOSXHints webserver **
alias wcd 'cd /Library/WebServer/Documents' ** My local webserver folder **
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010201183508573