Chapter 2. A Shell Primer
In This chapter:
Command Input and Output
Files and Directories
Running Commands in the Background
When Do Spaces Matter?
The Shell Startup Files
This chapter provides a simple, quick introduction to the shell. You should read it if you’re a newcomer to the shell and/or UNIX, or if you want a general review before reading the rest of this handbook.
If a command used here is unfamiliar to you, try the man command to read the relevant online manual page. For example, if you don’t know what wc is when it appears in an example, you can find out that it’s a word-counting program by using the following command:
To read about the man command, use this command:
Another helpful reference is the O’Reilly & Associates handbook UNIX in a Nutshell.
To enter a command, type it and press the
RETURN key. Some commands are simple enough that you can run them by typing just their name. Here are a few:
dateDisplay current date and time %
whoShow who is logged in %
lsList contents of your current directory %
clearClear the screen %
logout(or exit) Terminate your login session
You’ll get an error message if the shell can’t find a command (errors usually occur when the command is nonexistent or you spelled its name incorrectly):
glarblNonexistent command glarbl: Command not found. %
dtaeMisspelling of date dtae: Command not found.
If you notice a typing mistake before you press
RETURN, you ...