15.5. Backslash

The backslash stops the shell from misinterpreting the next character if it has special meaning to the shell. The following characters may have special meaning: & * = ^ $ ` " | ?.

Issuing the echo command with an * causes a listing of the whole current directory in a squashed up format, instead of echoing just the asterisk.

						$ echo * 

conf.linuxconf conf.modules cron.daily cron.hourly cron.monthly 
cron.weekly crontab csh.cshrc default dosemu.conf dosemu.users exports 
fdprm fstab gettydefs gpm-root.c 
onf group group- host.conf hosts hosts.allow hosts.deny httpd inetd 
...
					

To disable the special meaning of the asterisk, use a backslash.

						$ echo \* 
*
					

The same thing goes for the $$ command which the shell interprets as your current ...

Get Linux and Unix Shell Programming 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.