|
|
The cp command copies files. To copy a file, type cp, the name of the file you want to copy, and the name you want to call the copy, then press <Enter>. Unlike DOS, a UNIX system does not tell you that the copy succeeded, but it shows you an error message if it did not. You can use a pathname (a directory) for the name of the copy to put a copy of a file in a particular directory. In this case, unless you specify otherwise, the copied file will be given the same name as the original but in a different directory.
cp mydir/afile /tmp
Try putting a copy of the message of the day file in your home directory:
$cp /etc/motd $HOME
$l $HOME/motd
-rw-r--r-- 1 susannah techpubs 464 Jun 24 17:47 /u/susannah/motd