10.5. Metacharacters

Metacharacters are special characters that are used to represent something other than themselves. As a rule of thumb, characters that are neither letters nor numbers may be metacharacters. The shell has its own set of metacharacters, often called shell wildcards. Shell metacharacters can be used to group commands together, to abbreviate filenames and pathnames, to redirect and pipe input/output, to place commands in the background, and so forth. Table 10.13 presents a partial list of shell metacharacters.

Table 10.13. Shell Metacharacters
Metacharacter Purpose Example Meaning
$ Variable substitution set name=Tom echo $name Tom Sets the variable name to Tom; displays the value stored there.
! History substitution ...

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.