1. Technology
Basic Linux Operations FAQ
Part 3 of the Linux Newbie Administrator Guide
 
 Related Resources
• Linux Newbie Administrator Guide
• 0. Linux Benefit
• 1. Before Installation
• 2. Linux Resources/Help
• 3. Basic Operations FAQ
• 4. Newbie Admin FAQ
• ~ 4.1 Lilo
• ~ 4.2 Drives
• ~ 4.3 X-Windows
• ~ 4.4 Configurations
• ~ 4.5 Networking
5. Shortcuts / Commands
• 6. Linux Applications
• 7. Learn Linux Commands
• A. How to Upgrade Kernel?
 

3.4.6 Meaning of quotes

Normally, these characters are special to the shell:

\ ' " ` < > [ ] ? | ; #  $  ^ & * ( ) = <Space> <Tab> <Newline>

There are four different types of quotes: backslash (\), single quotes (apostrophes, '), double quotes (quotation marks, "),  and backquotes (`).

The backslash \ means: disable the special meaning of the subsequent character.

Quoting with '' (two apostrophes) means:  quote exactly, disabling any special characters inside the quotes.

Quoting with "" means:  disable the special characters inside the quotes except for $ ` \

The pair `` (two backquotes) means:  do a command substitution inside the backquotes first. So what is inside the backquotes is executed by the shell first, and then the output is passed to the command outside the quotes.  The same can also be acomplished with $(command) which nests better than backquotes.

Examples. I can create a funny directory called "*" by either \ quoting or '' quoting:

mkdir \*
mkdir '*'

This hides the special meaning of the "*" from the shell (without the quote it would mean "all files in the current directory").

Next > 3.4.7 Input/output redirection

Can't find what you are looking for?
Search the

Stay up-to-date!
Subscribe to the Linux free newsletter.

You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

©2014 About.com. All rights reserved.