How to Install and Use rsync on Rocky Linux 9

To install and use rsync on Rocky Linux 9, follow these steps:

Step 1 : Update

sudo dnf update

Step 2 : Once the system is updated, you can proceed to install rsync. Use the following command:

sudo dnf install rsync

Step 3 : Copying Files Locally

- You can use rsync to copy files within your local system. For example, to copy a directory from one location to another, use the following syntax:

rsync -av /path/source_directory /path/destination_directory

Step 4 : Uploading to a Remote Server

- To upload files to a remote server, use a command like the following:

rsync -av /path/local_directory username@remote_server:/path/remote_directory

Step 5 : Downloading from a Remote Server

- To download files from a remote server to your local machine, use a command like this:

rsync -av username@remote_server:/path/remote_directory /path/local_directory

Congratulations! You have successfully installed rsync on Rocky Linux 9.