Skip to content
GEEKnodes

Raspberry Pi · Updated on

See Progress When Copying or Moving Files on Raspberry Pi OS Lite

See percentage, speed and time left when copying or moving files on Raspberry Pi OS Lite with progress, rsync, pv and dd from the terminal.

When you copy or move large files on Raspberry Pi OS Lite with cp or mv, the terminal just “waits” without telling you anything until it finishes. With a slow USB drive or a multi-gigabyte copy, not knowing whether it is at 10% or 90% is maddening. This guide shows several ways to see progress, starting with the progress utility the original article proposed.

Before you start

  • Raspberry Pi OS (Lite or desktop) and terminal access, locally or over SSH.
  • An up-to-date package list:
sudo apt update

Option 1: progress, for commands already running

progress is a small utility that looks in /proc for running coreutils commands (cp, mv, dd, tar, gzip/gunzip, cat…), checks which files they have open and where they are, and shows percentage, speed and time left. Its big advantage is that it works with a copy you already started.

A second terminal checks the percentage and pace of a copy that is still running.
progress watches a copy already underway and shows how it advances.

Install it

The original article compiled it from GitHub, but today it is in the Debian repositories for Bookworm and Trixie, both 32 and 64-bit, so just:

sudo apt install progress

Use it

Start your copy as usual in a terminal session:

cp /media/usb/pelicula.mkv ~/videos/

And in another session (another SSH window, for example) run:

progress

It shows one line per running copy. To keep updating until it finishes:

progress -M

Quit with Ctrl+C. Other useful forms:

# Start the copy in the background and follow it in the same terminal
cp pelicula.mkv /media/usb/ & progress -mp $!

# Compact view refreshing every 2 seconds
watch progress -q

$! is the PID of the last background process, and -m makes progress watch it until it ends.

In this video you can see progress working on a Raspberry:

Option 2: rsync, ideal for folders

rsync comes preinstalled on Raspberry Pi OS and, besides copying, can resume an interrupted copy. To see overall progress for the whole transfer:

Comparison of copying the contents with `fotos/` and the nested folder when using `fotos`.
The trailing slash on the source decides whether the contents or the whole folder is copied.
rsync -ah --info=progress2 /media/usb/fotos/ ~/fotos/
  • -a preserves permissions, dates and links, and copies recursively.
  • -h shows sizes in readable form (MB, GB).
  • --info=progress2 shows a single counter for the whole job instead of one per file.

To “move” instead of copy, add --remove-source-files: it deletes each source file after copying it (empty folders remain).

Watch the trailing slash on the source: fotos/ copies the folder’s contents; fotos copies the whole folder into the destination.

Option 3: pv, for pipes and single files

pv (pipe viewer) shows a progress bar for any data passing through a pipe. It is not preinstalled:

Data flow from a folder through `tar`, `pv` and `gzip` to a compressed file.
pv shows the data advancing as it passes through the pipe.
sudo apt install pv

Copy a file with a progress bar:

pv pelicula.mkv > /media/usb/pelicula.mkv

Or compress a folder while watching progress:

tar cf - fotos/ | pv | gzip > fotos.tar.gz

Option 4: dd with status=progress

If you copy disk images or cards, dd has its own indicator:

A disk image is written to a device with a progress bar and a warning.
dd reports progress while writing the image to the target device.
sudo dd if=raspios.img of=/dev/sdX bs=4M status=progress conv=fsync

Replace /dev/sdX with the right device (check with lsblk): dd overwrites without asking, and picking the wrong disk erases its data.

Check that it works

A quick way to test it without waiting for a real copy is to create a large test file and copy it:

dd if=/dev/zero of=prueba.bin bs=1M count=1024 status=progress
cp prueba.bin prueba-copia.bin & progress -mp $!
rm prueba.bin prueba-copia.bin

You should see the percentage advance. The last command deletes both test files.

Common problems

progress says No command currently running. No compatible command is running, or it finished before you ran it. Or another user launched it: try sudo progress.

The copy reaches 100% but the command does not finish. The system caches data and then writes it to disk. Wait and run sync before unplugging the USB.

Very low speeds with USB drives. Check the drive is on a USB 3 (blue) port on the Pi 4 and 5, and the power supply gives enough current for a mechanical drive.

rsync copies the folder into itself or the wrong place. Check the trailing slash on the source (folder/ versus folder).

You get disconnected from SSH and the copy stops. Run it inside tmux or screen (install them with apt) so it continues if the session closes.

Gear

Raspberry Pi 4 (4 GB) Raspberry Pi 4 (2 GB)

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor