cd - Change Directory
This command moves one around the directory structure:
Changes the current working directory to the directory is given in the directory_path. The path is the route to the new working directory and can be given as an absolute path (complete path) or a relative path (partial path). A complete path or absolute path is the complete route to move from the root directory to target directory. Using the relative or partial path, the system will look for the first directory listed within the current working directory and then the sequence of directories or the route to the final sub-directory. The pwd command can be used to show the absolute path to the new working directory.
Remember the two special files . and ..? A relative directory path can be specified using the .. file name, to move to the parent directory, followed by the path from the parent directory to the final directory. For example: if /home/user_one/funny is the current working directory and the not_funny directory, which is within the user_one directory is the target directory. Using:
will accomplish the change.
Another short hand for the home directory is the ~ character. It always refers to ones home directory so typing ~/ at the beginning of a directory path is a absolute reference to ones home directory. For example:
would make the move to /home/user_dir/not_funny if the users home directory was /home/user_dir.
One last shortcut: simply typing:
will always move one to their home directory.
Home - Table Of Contents - Contact Us
CertiGuide to A+ (A+ 4 Real) (http://www.CertiGuide.com/apfr/) on CertiGuide.com
Version 1.0 - Version Date: March 29, 2005
Adapted with permission from a work created by Tcat Houser et al.
CertiGuide.com Version © Copyright 2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.