Command syntax and command names

Although some commands can be entered by simply typing one word, other commands use flags and parameters. Each command has a syntax that designates both the required and optional flags and parameters.

The general format for a command is as follows:
CommandName flag(s) parameter(s)

The following are some general rules about commands:

  • Spaces between commands, flags, and parameters are significant.
  • Two commands can be entered on the same line by separating the commands with a semicolon (;). For example:
    $ CommandOne;CommandTwo
    The shell runs the commands sequentially.
  • Commands are case-sensitive. The shell distinguishes between uppercase and lowercase letters. To the shell, print is not the same as PRINT or Print.
  • A very long command can be entered on more than one line by using the backslash (\) character. A backslash signifies line continuation to the shell. The following example is one command that spans two lines:
    $ ls Mail info temp \
    (press Enter)
    
    > diary
    (the > prompt appears)

    The > character is your secondary prompt ($ is the nonroot user's default primary prompt), indicating that the current line is the continuation of the previous line. Note that csh (the C shell) gives no secondary prompt, and the break must be at a word boundary, and its primary prompt is %.

The first word of every command is the command name. Some commands have only a command name.