OpenWindows Advanced User's Guide

4.1.6 Single or Double Quotes on Command Lines

As shown earlier, you use quotation marks to surround text that you want to be interpreted as one word. For example, you would type the following to use grep to search all files for the phrase "dang it, boys":

$ grep "dang it, boys" *

Single quotation marks (') can also be used to group multiword phrases into single units. Single quotation marks also make sure that certain characters, such as $, are interpreted literally. (The history metacharacter ! is always interpreted as such, even inside quotation marks, unless you escape it with a backslash.) In any case, it is a good idea to escape characters such as & ! $ ? . ; and \ when you want them taken as ordinary typographical characters.

For example, if you type:

$ grep $ list

you will see all the lines in list. However, if you type:

$ grep '\$' list

you will see only those lines with the "$" character in them.

For more information on the grep(1) command, refer to the man Pages(1): User Commands.