February 2004
Beginner
200 pages
5h 40m
English
If a character has special meaning to the shell but you want it used literally (e.g., * as a literal asterisk rather than a wildcard), precede the character with the backforward slash "\” character. This is called escaping the special character:
$ echo a* As a wildcard, matching "a" filenames aardvark agnostic apple $ echo a\* As a literal asterisk a* $ echo "I live in $HOME" Dollar sign means a variable value I live in /home/smith $ echo "I live in \$HOME" A literal dollar sign I live in $HOME
You can also escape control characters (tabs, newlines, ^D, and so forth) to have them used literally on the command line, if you precede them with ^V. This is particularly useful for tab (^I) characters, which the shell would otherwise use for filename completion (see Filename completion).
$ echo "There is a tab between here^V^Iand here"
There is a tab between here and here