Preface
Introduction
Practice Setup
Linux Architecture
Basic Commands
Basic file management or operations on file
User administration
Networking
Linux Interview Questions

 

 

CD Command :

CD stands for Chang Directory. This command is used to change the current directory to another directory. In one way we can say, this command is used to navigate within the directories.

$pwd

/admin

The above output represents that our presently working directory is admin under root directory(/ ).

For suppose we created a directory under this admin directory

$ mkdir abclearn

Created a directory with the name of abclearn.

Actually, when any command is executed that will effected in the current directory only. So it is necessary to move from current directory (/admin) to newly created directory. Then we can use CD command.

$pwd

/admin

.. to change from this path to new directroy

$ cd abclearn

$pwd

/admin/abclearn

.. now the path is changed to abclearn. So, we can work in this directory.

CD command having some of attributes

CD /          which moves to the root directory

CD ..        moves to the parent directory of the current directory.

For example

$pwd

/admin/abclearn

$cd ..

$pwd

/admin

The meaning above command is that the current directory path is changed from abclearn to its parent directory admin.

$cd abclear

$ pwd

/admin/abclearn

This command specifies that from admin directory the path is moved to its child directory called abclearn.

$ cd /

It moved the current directory path to its root directory.

$pwd

/

It is possible