To copy files with progress displayed in the terminal, you can use the pv (Pipe Viewer) command in combination with cp. Here's how you can do it:
-
Install
pv(if it's not already installed):- On Debian/Ubuntu:
sudo apt-get install pv - On Red Hat/CentOS:
sudo yum install pv
- On Debian/Ubuntu:
-
Use
pvwithcp:
You can use the following command to copy a file while showing the progress:pv source_file > destination_fileFor example:
pv largefile.zip > copy_of_largefile.zip -
Copying a directory:
If you want to copy a directory and show progress, you can usetarin combination withpv:tar cf - source_directory | pv | tar xf - -C destination_directory
This will display the progress of the copy operation in the terminal.
