Linux Commands for Copying Files Between Computers

Copy files with the RCP, SCP, or FTP command

rcp, scp, ftp commands

There are a number of Linux commands you can use to copy files from one computer to another. When you use a copy command, files can move between computers from the command line instead of via the graphical interface provided by the operating system.

Tip: Other operating systems use similar copy commands. For example, Windows users can use the copy command or xcopy command from Command Prompt.

Linux Copy Commands

The RCP (remote copy) command is meant to work like the CP (copy) command, except that is allows you to copy files and directories over the network to and from remote computers.

This is nice and simple, but to make it work you need to first set up the computers involved in the transaction to allow this operation. This is done using the .RHOSTS files to type out each computer that's allowed to make the connection.

A more secure version of RCP is SCP (secure copy). It's based on the SSH ("secure shell") protocol, which uses encryption. You can use the SCP command to copy files between a local and remote computer or between two remote hosts.

Another Linux command for copying files is FTP (file transfer protocol). The key advantage for most people to use FTP is that an FTP client program comes built-in with most operating systems, including Linux distributions and Windows. Plus, FTP doesn't require an RHOSTS file. You can copy multiple files with FTP, but the more basic FTP clients typically do not transfer whole directory trees.