To synchronize files between your local machine and a server, you can download software but did you know you can also do it with one single terminal command?

Use RSYNC to Synchronise a directory to a linux server.

Synchronise files to server

This command will synchronise the contents from local sourcefolder to targetfolder on the server and will prompt for the server password.

rsync -zaP --delete ./sourcefolder/.

Meaning of the parameters

parameter description
z compress data during the transfer
a archive files and directory while synchronizing. Ensures recursion
P show progress during transfer
–delete delete files on the server that are not on the sending side
Written by Loek van den Ouweland on 2020-10-15.
Questions regarding this artice? You can send them to the address below.