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]
commandnameThe name of the command comes first.
argumentIf there are any arguments to the command, they follow the command name.
inputfileIf there is an input redirection symbol
“<”, input comes from
, otherwise it comes from the keyboard.inputfile
outputfileIf there is an output redirection symbol
“>”, output is sent to
,
otherwise it is sent to the screen.outputfile
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
is used as the input for
command1; the output of
command2 is used as the input for
command2; and so on.command3