How can I change directories?

QuestionsQuestions8 SkillsProDec, 23 2025
0130

Hello! I'm Labby, and I'd be happy to help you with that.

In Linux, you use the cd command to change directories. cd stands for "change directory".

Since you are currently learning about your working environment, here are the most common ways to use it:

  1. Go to a specific folder:
    If there is a folder named project inside your current directory, you type:

    cd project
  2. Go back to your Home directory:
    As mentioned in your current lab step, ~ represents your home directory. You can jump straight there by typing:

    cd ~

    (Or simply type cd and press Enter; it does the same thing!)

  3. Go up one level:
    If you want to move to the "parent" folder (the one containing your current folder), use two dots:

    cd ..
  4. Go to an absolute path:
    You can go anywhere by providing the full path, for example:

    cd /home/labex/project

Try this now:
Type cd ~ in your terminal, and then type pwd. You will see your location change from /home/labex/project to /home/labex.

Feel free to ask if you have more questions! Happy learning!

0 Comments

no data
Be the first to share your comment!