[Next] [Previous] [Up] [Top] [Contents] [Index]

Chapter 5: Important UNIX Concepts

5.2 Command Entry

A UNIX command is either a built-in command or the name of an executable file which the operating system will load and execute. When you see the prompt, you can enter a command by typing the command name, any options and arguments, followed by a carriage return.

Recall, the formats displayed in this manual use this font style to indicate characters to be typed as is, and this font style to indicate arguments to be substituted. Arguments enclosed in square brackets, [...], are optional.

You should be aware that UNIX commands are not noted for their consistency of format. Furthermore, commands, formats, arguments, and options may vary slightly from one UNIX flavor to another. In this manual, we attempt to be as generic as possible, and describe options that are widely available.

UNIX commands are described on-line in the man pages (see section 3.1).

5.2.1 Command Format

The basic format of UNIX commands is:

% command -option(s) argument(s) 

where:

%

is the (default, non-FUE) csh prompt.[18]

command

is the UNIX command name of a utility or tool.

option(s)

modifies how the command runs; options are nearly always preceded by a dash and listed one after another. See example below.

argument(s)

specifies data or entities (usually files) on which the command is to operate; arguments are separated by blanks ("white space").

Remember, UNIX is case-sensitive. Therefore UNIX commands must be entered in the correct case. Most of the time commands are entered in lower case.

The components are separated by at least one blank space. If an argument contains a blank, enclose the argument in double quote marks. Normally, options can be grouped; e.g., the -lw and the -l -w option specifications are equivalent in the examples below (wc is a sample command; it lists line, word, and/or character count of one or more files.):

% wc -lw file1 file2
% wc -l -w file1 file2

Some options can have arguments, and there isn't consistency on whether there should be a blank space between the option and its argument. Check the man pages when you're not sure. In the next example which shows the FORTRAN command, outputfile is the argument of the option -o:

% f77 -o outputfile program.f 

Looping and conditional commands are also supported. These are more advanced shell commands and are not covered in this manual. Consult a UNIX text for information on these.

5.2.2 Miscellaneous Command Line Features


[18] $ is the non-FUE default for Bourne shell.

UNIX at Fermilab - 10 Apr 1998

[Next] [Previous] [Up] [Top] [Contents] [Index]