Difference between double quote and single quote

suggest change

Double quote | Single quote ———— | ———— Allows variable expansion | Prevents variable expansion Allows history expansion if enabled | Prevents history expansion Allows command substitution | Prevents command substitution \* and @ can have special meaning | \* and @ are always literals Can contain both single quote or double quote | Single quote is not allowed inside single quote $, `, ”, \ can be escaped with \ to prevent their special meaning | All of them are literals

Properties that are common to both:


$ echo "!cat"
echo "cat file"
cat file
$ echo '!cat'
echo "\"'\""
$ a='var'
$ echo '$a'
$ echo "$a"

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents