[Next] [Up] [Previous] [Contents]
Next: Correcting typos Up: Overview Previous: The shell

Command syntax

Unix commands begin with a command name, often followed by flags and arguments some of which are optional. The generic syntax is:


    command [flags] argument1 argument2 ...
Normally the flags are preceded by a hyphen to prevent them from being interpreted as a filename. For example, in the command line


    ls -l avhrr
ls is the program called, -l is the flag, and avhrr is the argument. This command tells the computer to list (in long format) the file called avhrr or, if avhrr is a directory, to list all the files in the directory avhrr.


c.c.taylor@ieee.org