tilde expansion
The shell replacing a tilde at the start of a word with your home directory path before a command runs.
In more detail
Because the shell does it, the command receives a full path such as /home/ada/data and never sees the tilde. It only happens unquoted and at the start of a word, so "~/data" in double quotes stays a literal tilde. ~ada expands to the home directory of the user ada.
Example
ls ~/dataRelated terms
- home directory — Your personal directory, such as /home/ada on Linux or /Users/ada on macOS, where your files and settings live.
- shell expansion — The rewriting bash does to a command line before running it, replacing variables, patterns and other special forms with their values.
- double quotes — Quotes that keep text together as one word but still let dollar expansions and backticks work inside.
Taught in
- Moving Around: pwd, ls, cd And Paths — Bash Scripting & Command Line Automation
- What Bash Does To A Line Before It Runs It — Bash Scripting & Command Line Automation