How to change current working directory?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 30 2025
0150

To change the current working directory in Linux, you can use the cd (change directory) command. Here’s how to do it:

  1. Basic Usage:
    To change to a specific directory, use:

    cd /path/to/directory
  2. Relative Path:
    If you want to change to a directory relative to your current location, you can do:

    cd directory_name
  3. Parent Directory:
    To move up one level to the parent directory, use:

    cd ..
  4. Home Directory:
    To change to your home directory, simply use:

    cd ~

    or just:

    cd
  5. Using Absolute Path:
    You can specify the full path to change to any directory:

    cd /home/username/documents
  6. Check Current Directory:
    After changing directories, you can confirm your current working directory by using:

    pwd

These commands will help you navigate the file system effectively.

0 Comments

no data
Be the first to share your comment!