O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required