single quotes
Quotes that make every character between them literal, so nothing inside is expanded.
In more detail
Use them for text that must arrive untouched, such as sed and awk programs or a grep pattern. The one thing you cannot put inside them is a single quote; end the quote, add an escaped quote, and start again.
Examples
echo 'hello $user'echo 'stop'\''and go'Related terms
- double quotes — Quotes that keep text together as one word but still let dollar expansions and backticks work inside.
- backslash — The \ character, which in the shell quotes exactly the one character that follows it.
- ANSI-C quoting — The $'...' quoting form, which works like single quotes but turns escape sequences such as \n and \' into the real characters.
Taught in
- Help, History, Completion And Aliases — Bash Scripting & Command Line Automation
- What Bash Does To A Line Before It Runs It — Bash Scripting & Command Line Automation
- Single Quotes, Double Quotes, Backslash — Bash Scripting & Command Line Automation
- The Unquoted Variable: Splitting And Globbing — Bash Scripting & Command Line Automation
- Finding Lines: grep And Regular Expressions — Bash Scripting & Command Line Automation
- Reshaping Text: cut, sort, uniq, tr, sed, awk — Bash Scripting & Command Line Automation
- Archives, Transfers And The Network — Bash Scripting & Command Line Automation