Go to the previous, next section.

UNIX Command Syntax

UNIX commands must be entered in the following form:

 command -options arguments

The command is always the first word. The options modify the function the command performs. The arguments identify the data (usually a file or files) upon which the command performs its function.

This syntax is almost universal within UNIX, but not quite. A few commands take options without the preceding dash, and some commands accept dashes but don't require them. Some commands require a dash for each option, instead of permitting you to group several options after one dash. If you have questions about a command's syntax, refer to the man pages (explained in Section See section Man Command) as the final authority.

Three additional areas you should know about using UNIX commands are: abbreviations, upper- and lower-case, and wild-card characters. The first two are simply explained:

The third is only a little more complicated. UNIX shells have two wild-card characters: ? and *. The ? character is used to match one character. For example, if you tell the system to find file ???, it will return all the file names that are three characters long. The * character is used to match file names containing a varied number of characters. For example, if you tell the system to find m*, it will return all the file names that start with `m' (for example, `me', `mother', and `mary' would all be returned). The * character can also be used before partial file names (for example, *.lis) and on both sides of partial file names (for example, *.*). A useful expression is .??* which matches all files beginning with a `.' and are at least 3 characters long. Files beginning with `.' are typically not displayed.

Go to the previous, next section.