Mobaxterm Rsync practical examples using a bash terminal

MobaXterm is a wonderful tool for every DevOps engineer. Today let us explore the rsync command with mobaxterm bash terminal to copy or sync files between. rsync is available by default in MobaXterm.

How to use rsync command in mobaxterm local bash terminal?

Let us have two directories, say: source, and destination:

[[email protected] test]$ ls -l
total 0
drwxrwxr-x 2 admin admin   6 Nov  2 04:49 destination
drwxrwxr-x 2 admin admin 159 Oct 25 01:19 source

The source directory is having a few files in it,

[[email protected] test]$ ls source/
file1.txt  file2.txt  file3.txt  file4.txt  file5.txt  file6.txt  file7.txt  file8.txt  file9.txt
Destination directory is empty.
[[email protected] test]$ ls destination/
[[email protected] test]$

Let us sync files from source to destination directory using rsync

[[email protected] test]$ rsync -av source/ destination/
sending incremental file list
./
file1.txt
file2.txt
file3.txt
file4.txt
file5.txt
file6.txt
file7.txt
file8.txt
file9.txt

sent 568 bytes  received 190 bytes  1,516.00 bytes/sec
total size is 0  speedup is 0.00
We used rsync with v, so it is showing verbose details.

Verifying the destination after rsync

[[email protected] test]$ ls destination/
file1.txt  file2.txt  file3.txt  file4.txt  file5.txt  file6.txt  file7.txt  file8.txt  file9.txt