WARNING: This site is intended for online use only; mass-downloading of pages degrades the server and is prohibited.
If you attempt to use tools to mass-download the site, you may be blocked permanently by automated software.
If you want to read this CertiGuide offline, please use one of the links on the left to purchase a convenient PDF copy. Thank you.

Read this whole guide offline with no ads, for a very low price!
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
head, tail - Output the First or Last Part of a File to the Screen
Previous Page
Pages in Current Topic/Section
1
Next Page
mv - Move (rename) Files
Next Topic/Section

cp - Copy Files or Directories

The cp command works similar to the copy command in DOS. The general form of this command is:

cp [options] source_location destination_location

This will copy the file source_location to destination_location.

Source_location and destination_location can be either an absolute (complete) address or a relative (partial) address. When copying, if destination_location is a directory, a new file will be created within destination_location, with the file name, source_location. If destination_location is a file name, the contents of source_location will be copied to destination_location. An important item to remember once again: UNIX philosophy assumes that one knows what they are doing. The cp command is not interactive by default. For example: if the destination file exists and has content; before the command is executed, it will not prompt to or ask if this action should be completed and warn that the file is about to be overwritten. It will simply overwrite destination_location. The interactive option (the -i option) will check to see if destination_location exists and if so, it will ask if destination_location is to be over written, with choice of y or n to allow or not allow the command to complete.

If source_location is a directory name then destination_location must also be a directory name. Additionally if source_location is a directory and contains directories, which contain files, and those are to be copied the -r option (recursive) must be used and will copy a directory, its contents, its sub directories, and all of their contents and sub directories and so forth to the destination_location directory.


Previous Topic/Section
head, tail - Output the First or Last Part of a File to the Screen
Previous Page
Pages in Current Topic/Section
1
Next Page
mv - Move (rename) Files
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.