Get the A+ 4 Real e-book for your own computer.
Click Here!

Custom Search







Table Of Contents  CertiGuide to A+ (A+ 4 Real)
 9  Chapter 5: The Linux Operating System
      9  Basic Concepts and Procedures for Creating, Viewing and Editing Files and Directories
           9  Common Commands

Previous Topic/Section
pwd - Print Name Of Current/Working Directory
Previous Page
Pages in Current Topic/Section
1
Next Page
touch - Change File Time Stamps
Next Topic/Section

cd - Change Directory

This command moves one around the directory structure:

cd [directory_path]

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:

cd ../not_funny

will accomplish the change.

Another short hand for the home directory is the ~ character. It always refers to one’s home directory so typing ~/ at the beginning of a directory path is a absolute reference to one’s home directory. For example:

cd ~/notfunny

would make the move to /home/user_dir/not_funny if the users home directory was /home/user_dir.

One last shortcut: simply typing:

cd

will always move one to their home directory.

Displaying Large Files

A word of caution: If a file display is more than one full screen, the data in the file will quickly scroll off-screen and the first part of file will be un-viewable. For files larger than 23 lines use either the more or the less command (described next). If the file is not a text file, sending a file such as a binary file to the screen can cause the terminal to be set in strange modes and can affect the way the terminal displays data. Logging off and back on will usually reset it.



Previous Topic/Section
pwd - Print Name Of Current/Working Directory
Previous Page
Pages in Current Topic/Section
1
Next Page
touch - Change File Time Stamps
Next Topic/Section

If you find CertiGuide.com useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider buying an inexpensive PDF equivalent of the CertiGuide to A+ (A+ 4 Real) from StudyExam4Less.com. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



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.