What are other special directory notations?

QuestionsQuestions8 SkillsProDec, 17 2025
0100

That's an excellent question! Beyond ~ (your home directory) and .. (the parent directory), there are a few other special directory notations that are very useful in Linux:

  1. . (Single Dot): Current Directory
    The single dot . represents your current working directory. While you don't often use cd . (since you're already there!), it's very common in other contexts, especially when executing scripts or specifying paths relative to your current location.

    • Example: ls . would list the contents of the current directory (same as ls).
    • Example: ./myscript.sh tells the shell to execute myscript.sh from the current directory.
  2. / (Forward Slash): Root Directory
    As mentioned in the lab step, a single forward slash / represents the root directory. This is the highest level in the Linux file system hierarchy, and all other files and directories branch off from it.

    • Example: cd / would take you to the root directory.
    • Example: /home/labex/project is an absolute path that starts from the root.
  3. - (Hyphen/Dash): Previous Directory
    The single hyphen - is a handy shortcut to navigate back to the previous directory you were in. It's like an "undo" button for cd commands.

    • Example: If you were in /home/labex and then typed cd /etc, then cd - would take you back to /home/labex.

These special notations make navigating the Linux file system much more efficient. Keep practicing with them, and they'll become second nature!

Do you want to try an example with any of these?

0 Comments

no data
Be the first to share your comment!