Linux Notes

Table of Contents

Section 8: Copying Files

We copy files using copy, cp, rcp and ftp commands. Those two last ones especially when the systems are different. The ftp command is just a standard ftp client, so I won't describe it in here.

copy

  • copies files and directories
$ copy [options] <file1> <file2>

Options:

  • -a copies with a query
  • -ad copies directories with a query
  • -l make a linked copy (not a physical one)
  • -m set file2 time and date to those read from file1
  • -r copy directory and the contents
  • -v diagnostic messages turned on

cp

  • copies files
$ cp <file1> <file2>
$ cp <file1> <file2> <directory>

rcp

  • copies files from one system to another
$ rcp [options] <source_system>:<file1> <target_system>:<file2>

Options:

  • -r copy entire directories and their contents