Understanding SSH CD command

CD command is used for navigation to different directories on a Linux machine. Below I have explained some basic things about CD command.

How to know current directory

If you want to know your current directory, run below command:


ssh-pwd command

Default directory for root

when you login as root your default directory is


How to move to another directory

Support you want to move to /home directory, use below command

cd /home

To go up a directory

To move to one level up directory use:

cd ..

To go to Top level

cd /

To go to your home directory

cd ~

This will take the use to his home directory. Like for user root home directory is /root

Our Recommended Dedicated Server

Leave us a Reply

Your email address will not be published. Required fields are marked *

* *