Tuesday, January 4, 2011

cd linux command

cd - To change the current directory.

Syntax :
cd /path/to/the/directory


cd .. :  Used to go back one directory on the majority of all Unix shells. It is important that the space between the cd and the ..

Examples:


cd hope 
The above example would go into the hope directory if it exists.

cd ../home/users/computerhope
The above example would go back one directory and then go into the home/users/computerhope directory.

cd ../../
Next, the above example would go back two directories.

cd
Finally, typing just cd alone will move you into the home directory. If you're familiar with MS-DOS and how typing cd alone prints the working directory. Linux and Unix users can print the working directory by using the pwd command.

No comments:

Post a Comment