AI Hints
Home›Linux Tutorial›Moving Around
Linux · Lesson 18 of 120

Special Paths

Tilde, dot, dot dot and dash.

⏱ 2 min read▶ Video at 20:37🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

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.

Special Paths
From the video: Special Paths
  • 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.

SymbolMeans
~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.

Terminal
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.

keyvalue
.right here
./script.shrun 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
Next up: ls Options — long, all, and human sizes