Special Paths
Tilde, dot, dot dot and dash.
Some little symbols have special meanings in paths. You've already met a couple of them. Let's put them all together, because you'll see them everywhere.

- Little symbols
- Special meanings
- You'll see them everywhere
Path shortcuts
Tilde means your home folder. A single dot means the folder you're in right now. Two dots mean the parent folder, one level up. And a dash, used with CD, means the folder you were in just before. Like a back button.
| Symbol | Means |
|---|---|
| ~ | your home folder |
| . | this folder |
| .. | the folder above |
| - | the previous folder (cd -) |
Using the shortcuts
Let's try them. CD to slash TMP. Then CD tilde slash Pictures goes to Pictures in your home folder, from anywhere. CD dash jumps back to slash TMP, and CD dash again jumps back to Pictures. Then CD dot dot slash dot dot climbs two levels, up past sam, to slash home.
cd /tmp cd ~/Pictures cd - /tmp cd - /home/sam/Pictures cd ../.. pwd /home
Why dot matters
The single dot looks useless, but it isn't. Some commands need a folder name, and dot means right here. For example, you'll use dot slash, to run a script in the current folder, later in this course.
| key | value |
|---|---|
| . | right here |
| ./script.sh | run a script from here |
| ls . | list this folder |
| cp file . | copy to here |
Summary
Tilde is home, dot is here, dot dot is up one level, and CD dash goes back. Next, getting much more detail from LS.
Key takeaways- ~ home
- . here, .. up
- cd - goes back