Learning How to Use the Command Line

Alright.  So you need to learn how to use the shell.  For some reason, people
make it out to seem like it's hard.  Getting basic tasks done in it isn't
too bad.  You'll be happy to have such a quick way to do things once you
start using it.  It's also just cool.

You can use the shell to write, edit, and run programs.  You can install and
configure software with it.  You can connect to a server, install software on
it, and configure the server's software from the shell.  You can automate
routine or boring tasks with shell scripts.  The shell is very powerful.  After
you start using it, you'll probably want to use it all the time.


Using the Shell

If you're on Mac OS X, open the application named Terminal
(which is located in /Applications/Utilities/Terminal.app).  This application
runs bash (the Bourne Again SHell).  You're also going to want to install the
homebrew package manager if you use Mac OS X.  If you're using Linux, you can
use the shell in an app named 'Terminal'.


Developing Basic Competence With the Shell

I'm not going to make this a tutorial.  I'll point you in the direction
of some resources you can use to get started.  



Getting Better With the Shell

There is a ridiculous amount of stuff you can do with the shell.  After you
know how to navigate your filesystem, install software, and write/execute
programs with the shell, you might be interested in becoming more skilled
with it.  

There are a bunch of powerful Unix utilities that can be piped together to get
a lot done with little effort.  Check out the commands named grep, sed, and
awk.  There are plenty of others you’ll learn about, but these are a few that
are really powerful.  I've listed some books at the end of this page that
contain plenty of reference material for you to use after you follow a
tutorial on basic shell use.


Regular Expressions

Regular expressions are a very powerful tool you can use for pattern matching.
For example, if you wanted to find all the places where a text file
contains a string that starts with an upper-case letter, is followed by
4 or more lower-case letters, then is followed by a symbol and at least 3
digits ranging in value from 0-9, you could do it with a regular expression
pattern. Lots of Unix tools support the use of regular expressions.  Complex
text processing can be done with surprisingly small shell scripts using
regular expressions.


UNIX Documentation

The easiest way to find out more about a command is to type 'man command',
replacing the text 'command' with whatever command you want to know more about.
For example, you could type 'man awk' to find out more about awk.

There are whole books written about certain Unix tools. I don't recommend
memorizing stuff when it comes to using Unix commands.  You learn by doing, and
it helps to have great reference materials around when you need them.  Various
books on Unix contain tons of helpful info, ranging from useful one-line
scripts to historical info about plenty of Unix stuff.

There is always more you could learn how to do, and too many command-line
utilities for you to learn all of them.  For now, this is enough for you to
get started.

At this point, you've learned a decent bit and have the hang of using some
important tools.  You should probably learn a little bit about version
control now.

Links to Reference Books:

Classic Shell Scripting
Unix Power Tools
Sed and Awk
Mastering Regular Expressions