📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Linux Command Line SCP and rsync

SCP and rsync

5 min read
scp copies files over SSH: scp file.txt user@host:/path. rsync is smarter — it only transfers changed parts and supports --delete for mirroring. Always use --dry-run to preview a sync before running it.

Copying Files Over SSH

# SCP — simple copy
scp file.txt user@server:/home/user/
scp -r folder/ user@server:/home/user/

# rsync — efficient sync (only transfers changes)
rsync -avz local/ user@server:/remote/
rsync -avz --delete local/ remote/   # mirror

# Dry run (see what would change)
rsync -avzn local/ remote/