Use scp for a straightforward one-off copy, sftp when you need to browse or run several file operations in an interactive or batch session, and rsync for repeated directory synchronization or mirroring. One important distinction: current OpenSSH scp uses SFTP for transfers by default; the scp command and the older SCP transfer protocol are not the same thing.
How do scp, sftp, and rsync differ?
| Tool | Best fit | How it works | Important caveat |
|---|---|---|---|
scp |
A direct, one-off file or directory copy | Copies between hosts over SSH. Current OpenSSH uses SFTP as its transfer protocol by default. | Use -O to select the legacy SCP protocol for compatibility with some older servers or legacy path and wildcard behavior. OpenBSD scp(1) manual |
sftp |
Browsing a remote location or performing several file operations | Provides interactive commands and batch input over encrypted SSH transport. | The server must expose an SFTP subsystem; some operations depend on server extensions. OpenBSD sftp(1) manual |
rsync |
Recurring transfers, directory synchronization, backups, and mirroring | Works locally, over a remote shell such as SSH, or through an rsync daemon. When destination data is available, its delta-transfer algorithm can send only file differences. | Remote-shell mode requires rsync on both machines. A source trailing slash changes the destination layout, and --delete removes destination-only files. Rsync manual |
When should you choose each command?
Choose scp for a simple copy
If you know the source and destination and want to copy a file or directory without an interactive session, scp is usually the simplest command. It uses SSH access and authentication. With current OpenSSH, the command transfers data using SFTP by default, rather than the legacy SCP protocol. The OpenBSD manual states: “Since OpenSSH 9.0, scp has used the SFTP protocol for transfers by default.” OpenBSD scp(1) manual
As an Amazon Associate I earn from qualifying purchases.
Choose sftp to browse or perform a sequence of file operations
Use sftp when you want to inspect a remote directory, change locations, upload or download multiple files, or run a sequence of commands from a batch file. It is useful when the next file or destination is not known in advance and you want to work from a remote-file prompt.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Choose rsync for recurring directory updates
Use rsync when you expect to transfer a directory tree repeatedly and want it synchronized with a destination. Its delta-transfer algorithm can use existing destination data to send only differences in files. That can reduce transferred data for recurring updates, but it is not a guarantee of a particular speed: results depend on the files, network, options, and endpoints.
#1 Best Overall
Examples: copy a file, use an SFTP session, or sync a directory
The commands below are illustrative; replace user, host, and remote paths with values for your environment.
Copy one file with scp
scp ./report.csv user@host:/srv/incoming/
This sends the local report.csv to the remote /srv/incoming/ directory. The SSH account must have access to the host and destination.
Browse and transfer files with sftp
sftp user@host
At the prompt, use commands such as:
pwdandlsto inspect the remote working directory and its contents.cd /srv/incomingto change the remote directory.put ./report.csvto upload a local file.get results.csvto download a remote file.byeto end the session.
For noninteractive use, put SFTP commands in a file and run:
sftp -b commands.txt user@host
Arrange noninteractive authentication for a batch job so it does not stop waiting for a password.
Synchronize a directory with rsync
rsync -av ./site/ user@host:/srv/site/
Here the trailing slash on ./site/ means “transfer the contents of this directory” into /srv/site/. If the source is written as ./site without the final slash, the destination ordinarily includes a site directory level. The archive option is commonly used for recursive transfer and attributes; verify that its metadata behavior suits the source, destination, and permissions you actually have.
What should you check before using rsync to mirror files?
Add --delete only when you intend the destination to match the source and want destination-only files removed:
Rank #4
rsync -av --delete ./site/ user@host:/srv/site/
Because --delete removes files that are not present at the source, confirm the source, destination, and transfer direction before running the command. For a remote-shell transfer, rsync must be installed on both endpoints. Rsync can also use an rsync daemon; that is a separate connection mode, so do not assume it has the same transport properties as rsync over SSH. Rsync manual OpenBSD openrsync(1) manual
Quick Recap
Best Value
What do the tools require from the server?
scp: SSH access. With the default modern OpenSSH behavior, the remote server also needs a usable SFTP subsystem. If compatibility requires the older protocol,scp -Oforces legacy SCP; the OpenBSD manual notes cases such as servers without SFTP support and some legacy wildcard or tilde-path behavior. OpenBSD scp(1) manualsftp: SSH access and an SFTP subsystem on the server. Some operations rely on server extensions. OpenBSD sftp(1) manualrsyncover SSH: SSH access and rsync installed on both the local and remote machines. Rsync daemon mode is another option, with different connection characteristics. Rsync manual
Quick decision guide
- For one known file or directory copy, use
scp. - For an interactive remote session or a batch of file operations, use
sftp. - For repeated directory updates or a mirror, use
rsync; check the source slash and avoid--deleteunless removals are intentional.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




