Google News
logo
Unix - Quiz(MCQ)
Which Unix command is used for changing the current directory?
A)
cp
B)
cd
C)
rm
D)
pwd

Correct Answer :   cd


Explanation : cd (change directory) command is used for moving around the file system. cd command is usually invoked with a argument. After invocation, it changes the current directory to the directory specified as argument. Cp command is used for copying files while rm command is used for deleting files.

For example: our current directory is /bin/user06 and we want to change our directory to a directory named dir_one which is inside the user06 directory. To do so, type the following:

$ cd dir_one
$pwd
/bin/user06/dir_one​

Advertisement