Next / Previous / Contents / TCC Help System / NM Tech homepage

3. Parts of a command

After you log in, you will get a prompt, that is, a request to type a command. The part of Unix that reads and executes your command is called a shell, and there are several different shells. Most users use the bash shell, which prompts with a dollar sign “$”. Some people prefer tcsh, which prompts with a percent sign “%”. Type this command to find out which shell you have:

echo $0

Here are the parts of a Unix command:

commandname [argument]… [<inputfile] [> outputfile]
commandname

The name of the command comes first.

argument

If there are any arguments to the command, they follow the command name.

inputfile

If there is an input redirection symbol “<”, input comes from inputfile, otherwise it comes from the keyboard.

outputfile

If there is an output redirection symbol “>”, output is sent to outputfile, otherwise it is sent to the screen.

It is also possible to link up several commands so that the output of each command is used as the input of the next command:

command1 | command2 | … | commandn

In this example, the output of command1 is used as the input for command2; the output of command2 is used as the input for command3; and so on.