How to navigate using dot and double dot?

QuestionsQuestions8 SkillsProBasic Files OperationsDec, 08 2025
060

You can navigate using the . and .. directories with the cd command in the terminal. Here are some examples:

  1. Navigate to the current directory (.):

    cd .

    This command does not change your location; it simply confirms that you are in the current directory.

  2. Navigate to the parent directory (..):

    cd ..

    This command moves you up one level in the directory hierarchy. For example, if you are in /home/user/documents, running this command will take you to /home/user.

  3. Navigate to a subdirectory from the current directory:
    If you want to go to a subdirectory while still using .., you can combine them. For example, if you are in /home/user and want to go to /home/user/documents, you can do:

    cd documents
  4. Navigate up two levels:
    You can also use .. multiple times to go up more than one level. For example:

    cd ../..

    This command will take you up two levels in the directory structure.

These commands help you efficiently navigate through the file system in a terminal environment.

0 Comments

no data
Be the first to share your comment!