cd command Updated on June 10, 2014 by Scott Mitchell 1 Minutes, 15 Seconds to Read When navigating through your server you may want to change to other directories. The cd command is the bash command to allow you to move to other folders within your account. Command: cd Synopsis: cd [dir] Options: Option Long name Description -P This forces the command to use the physical directory structure and does not include symlinks. -L This forces the command to use the logical directory structure and includes any symlinks. Examples Below are a few examples of using the cd command. You can confirm your loction after running your cd command by using the pwd command. cd [dir] – This command moves you to the path you specify. If you begin the path with a / it will start at the root folder for your account, as in the example below. # cd /home/userna5/public_html # pwd /home/userna5/public_html cd [dir] – Continuing the above example, not using a / in the path begins from your current location. In this example, we begin in the /home/userna5/public_html directory. # cd images # pwd /home/userna5/public_html/images cd .. – This command moves you to the directory just above your current location. # pwd /home/userna5/public_html/images # cd .. # pwd /home/userna5/public_html cd / – Using only the / as the path will return you to the root folder. # cd / # pwd / cd ~ – When using the ~ (tilde) character as the path, you will be returned to your home directory. The example below assumes a user named userna5. # cd ~ # pwd /home/userna5 Share this Article Related Articles Understanding Linux Operating Systems How to Install Python 3.9 on CentOS 7 Speed Up grep Searches with LC_ALL=C How To Install RubyGems On Linux unrar and rar Commands 5 Ways to Find a File in Linux Setting Your PHP Settings in Command Line How to Check the Memory Usage on Linux How to Send Files to the Trash Can in Linux with Gio Trash How to Merge PDF Files in the Linux Terminal