How to copy with progress?

0127

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:

  1. Install pv (if it's not already installed):

    • On Debian/Ubuntu:
      sudo apt-get install pv
    • On Red Hat/CentOS:
      sudo yum install pv
  2. Use pv with cp:
    You can use the following command to copy a file while showing the progress:

    pv source_file > destination_file

    For example:

    pv largefile.zip > copy_of_largefile.zip
  3. Copying a directory:
    If you want to copy a directory and show progress, you can use tar in combination with pv:

    tar cf - source_directory | pv | tar xf - -C destination_directory

This will display the progress of the copy operation in the terminal.

0 Comments

no data
Be the first to share your comment!