
The home directory has a special character assigned to it-the ~ (tilde) character. When you log in to your system, the home directory is set as the current working directory by default. On a Linux system, the /home directory is a special directory reserved for a user's personal files, programs, and subfolders. If you don't know the exact name of the subfolder that you want to switch to, use the ls command to list down every directory in that folder. On the other hand, if you want to switch to the /Desktop directory using a relative path, all you have to type is:Ĭd keeps track of what directories are above and below the current directory, to allow a user to quickly shift to other directories without having to type the whole pathname. You can move up and down the directory tree efficiently with the cd command if you're well-versed on relative paths.įor example, if your current working directory is /home, and you want to change the directory to /Desktop. On the other hand, the relative pathname is derived from the current working directory. The absolute pathname is the complete path to the directory, starting from the / (root) folder. where options are the arguments passed with the command and path is the absolute or relative path to the directory.īefore you can use the cd command to its full extent, you must know the difference between absolute and relative pathnames. Some other implementations of the command such as chdir, used in MS-DOS systems, are also present. One of the most fundamental commands in Linux, cd has become a global command for switching directories. The cd command stands for Change Directory. Here's how you can use the cd command on Linux, the only utility that you'll ever need to traverse through directories on your system storage.



Luckily, Linux provides you with a command known as cd, which allows you to easily change the current working directory on your terminal. While many file managers are available that allow you to switch directories and navigate your disk drives in a graphical way, doing the same using the command line can provide you better control over your system. System navigation is one of the most basic tasks that a user can perform on an operating system.
