What other shortcuts exist for directories?

QuestionsQuestions8 SkillsProDec, 21 2025
0101

That's a great question! Besides the ~ (tilde) shortcut, there are a few other very common and useful directory shortcuts in Linux that you will use frequently:

1. The Current Directory (.)

A single dot represents the directory you are currently in.

  • Example: If you want to run a script located in your current folder, you might use ./script.sh.

2. The Parent Directory (..)

Two dots represent the directory one level above your current location (the parent directory).

  • Example: To move up one level, you would type:
    cd ..

3. The Previous Directory (-)

A dash represents the directory you were in just before your last move. It's like a "back" button for your terminal.

  • Example: If you moved from /home/labex to /etc, typing the following will take you back to /home/labex:
    cd -

4. Direct to Home (cd with nothing)

While not a symbol like the others, simply typing cd without any arguments is a shortcut that automatically takes you back to your home directory (~).

Summary Table:

Shortcut Meaning
~ Home directory (/home/labex)
. Current working directory
.. Parent directory (one level up)
- Previous working directory

Understanding these will make navigating the Linux file system much faster! Do you want to try practicing the cd .. command to see where it takes you?

0 Comments

no data
Be the first to share your comment!