Examples of using the cd command

Examples of using the cd command

To move down one level to a subdirectory:

   cd Firstyear

This moves you down one level from your current directory to the subdirectory Firstyear.


To move up one level of the directory tree:

   cd ..

Every directory contains a hidden directory .. (dot dot) that is a shorthand name for this directory's parent directory.

Using this shorthand name enables you to move up the directory tree very quickly without having to enter long pathnames.


To move to another directory using a relative pathname:

   cd ../Secondyear

This moves you up one level in the directory tree and then moves you into the subdirectory Secondyear.


To move to a directory using a full pathname:

   cd /home/physics/ercy04/ProjectX

This moves you to the directory ProjectX which is in the home directory of the user ercy04.


To go directly to your home directory:

   cd

[Home] [Search] [Index] This site maintained by unixhelp@math.rutgers.edu
This page was last updated on September 05, 2006 at 10:30 am and is maintained by webmaster@math.rutgers.edu.
For questions regarding courses and/or special permission, please contact mclausen@math.rutgers.edu.
For questions or comments about this site, please contact help@math.rutgers.edu.
© 2012 Rutgers, The State University of New Jersey. All rights reserved.