Stage 8 · Lesson 3 of 9
Copying files: scp and rsync
Two tools copy files to and from a server over . is fine for a single file: scp file.txt myvps:~/. rsync is better for folders: rsync -avz ./site/ myvps:/var/www/site/. It only sends what changed and can resume after a break. --delete also removes files on the other side that you removed locally.
Watch the slash at the end of the source. With it, rsync copies what is inside the folder; without it, it copies the folder itself. Run with --dry-run first to see what would change. rsync also works as a simple backup tool.
Common traprunning rsync with --delete and the source and destination swapped, which deletes the files you meant to keep.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- GuideFreeInitial Server Setup with Ubuntu (DigitalOcean)
DigitalOcean · Beginner
A clear, widely used checklist for a new user, sudo, SSH access and a firewall on Ubuntu
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
The command-line environment lecture covers SSH, tmux, job control and dotfiles
Practise
Keep handy
Also worth your time
- roadmap.sh: LinuxGo deeper
The server, networking and troubleshooting branches of the Linux map