Interview Prep/Linux/Networking, SSH & Scheduling

How do you copy files over SSH? scp vs rsync vs sftp.

BeginnerConceptNetworking, SSH & Scheduling
Answer
scp -r ./dist user@web:/var/www/      # simple copy (OpenSSH 9 uses SFTP protocol underneath)
rsync -avz --delete ./dist/ user@web:/var/www/dist/   # delta transfer, resumable
sftp user@web                          # interactive

rsync only sends changed parts, preserves metadata, and can resume, so it is the default for anything big or repeated. The trailing slash on the source means "contents of".

All Linux questions Roadmap: Linux

More on Networking, SSH & Scheduling