You can use the rsync
command with the --progress
option to display a progress bar while copying files. Here’s how to do it:
- Open a terminal window on your Linux machine.
- Type the following command to copy a file or directory from the source to the destination, and show a progress bar:
rsync --progress -r source/ destination/
Replace
source
anddestination
with the paths to the source and destination directories or files. The-r
option tellsrsync
to copy the directory recursively. - Press Enter to execute the command. You should see a progress bar that shows the percentage of the file or directory that has been copied, as well as the transfer rate.
sending incremental file list
file1.txt
1048576 4% 13.24MB/s 0:00:15
file2.txt
2097152 8% 11.56MB/s 0:00:20
...
The progress bar will update in real-time as
rsync
copies the files or directories.
Note that rsync
also has many other options that you can use to customize the behavior of the copy operation, such as --delete
to delete files from the destination that don’t exist in the source, or --exclude
to exclude specific files or directories from the copy. You can consult the rsync
manual page by running man rsync
in the terminal to learn more about these options.