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

CHAPTER 6 Special Unix Features

6.3 Other Special Command Symbols


In addition to file redirection symbols there are a number of other special symbols you can use on a command line. These include:

; command separator

& run the command in the background

&& run the command following this only if the previous command completes successfully, e.g.:
grep string file && cat file

|| run the command following only if the previous command did not complete successfully, e.g.:

grep string file || echo "String not found."

( ) the commands within the parentheses are executed in a subshell. The output of the subshell can be manipulated as above.

' ' literal quotation marks. Don't allow any special meaning to any characters within these quotations.

\ escape the following character (take it literally)

" " regular quotation marks. Allow variable and command substitution with theses quotations (does not disable $ and \ within the string).

'command' take the output of this command and substitute it as an argument(s) on the command line

# everything following until <newline> is a comment

The \ character can also be used to escape the <newline> character so that you can continue a long command on more than one physical line of text.


Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]