DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

Which Should You Use: scp, sftp, or rsync? Examples and Key Differences

Use scp for a one-off copy, sftp for interactive or batch file operations, and rsync for recurring directory synchronization. See examples and compatibility notes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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:

  • pwd and ls to inspect the remote working directory and its contents.
  • cd /srv/incoming to change the remote directory.
  • put ./report.csv to upload a local file.
  • get results.csv to download a remote file.
  • bye to end the session.

For noninteractive use, put SFTP commands in a file and run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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:

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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 -O forces legacy SCP; the OpenBSD manual notes cases such as servers without SFTP support and some legacy wildcard or tilde-path behavior. OpenBSD scp(1) manual
  • sftp: SSH access and an SFTP subsystem on the server. Some operations rely on server extensions. OpenBSD sftp(1) manual
  • rsync over 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

  1. For one known file or directory copy, use scp.
  2. For an interactive remote session or a batch of file operations, use sftp.
  3. For repeated directory updates or a mirror, use rsync; check the source slash and avoid --delete unless 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.