Quotes

Quotes

One issue that causes its share of confusion is quotes. As most of know from writing, quotes are used to delimited text from the rest of the what we are writing. Typically in English, when something is quoted it is contained within double-quotes. Aslo in English, quotes within the double-quotes are typical contained within single-quotes.

As with English, quotes in Linux are used to set something apart from the rest of the command line or you want to tell the system that whatever is inside the quotes needs to be seen as a single unit. One commone usage is when a file or directory name contains a space. You can use quotes to pass the entire name to the respective programm instead of having the shell see the parts before and after the space as a separate token.

In Linux, there are three kinds of quotes: double-quotes (“), single-quotes (‘), and back-quotes(“) (also called back-ticks). On most US keyboards, the single-quotes and double-quotes are on the same key, with the double-quotes accessed by pressing Shift and the single-quote key. Usually this key is on the right-hand side of the keyboard, next to the Enter key. On a US-American keyboard the back-quote is usually in the upper left-hand corner of the keyboard, next to the 1.

Each of these three kinds of quotes have different purposes and they behave different in terms of how they behaves. Although the behaviour is actually straight forward, it is common that quotes used impoperly and the users ends up getting behaviour they did not expect.