Cmds 3
Cmds 3
cd command in linux known as change directory command. It is used to change current working
directory.
Syntax:
$ cd [directory]
$ cd [directory_name]
In the above example, we have checked number of directories in our home directory and moved
inside the Documents directory by using cd Documents command.
cd /: this command is used to change directory to the root directory, The root directory is
the first directory in your filesystem hierarchy.
$ cd /
$ cd dir_1/dir_2/dir_3
In above example, we have the document directory and inside the document directory we
have a directory named geeksforgeeks and inside that directory we have example
directory. To navigate example directory we have used command cd
Documents/geeksforgeeks/example.
$ cd ~
or
$ cd
$ cd "dir name"
In above example, we have navigated the My songs directory by using cd “My songs”
command.
or
$ cd dir\ name :