pbar
is a simple shell script that wraps common command-line utilities (rsync
, dd
, cp
, mv
, curl
, wget
) to provide a visual progress bar using the pv
(Pipe Viewer) command. It allows you to monitor the progress of long-running operations that typically don't show progress by default.
- Adds a progress bar to several common commands.
- Supports customizable bar styles.
- Lightweight and easy to use.
pv
(Pipe Viewer) command must be installed on your system. You can usually install it via your system's package manager (e.g.,sudo apt-get install pv
on Debian/Ubuntu,brew install pv
on macOS).
You can quickly install pbar
by running the following command:
curl -sSL https://raw.githubusercontent.com/guileh/shell_progress_bar/main/install.sh | bash
This command downloads the install.sh
script and executes it, which will place pbar
in /usr/local/bin/
and make it executable.
- Clone the repository:
git clone https://github.com/guileh/shell_progress_bar.git cd shell_progress_bar
- Make the script executable:
chmod +x pbar
- Add
pbar
to your PATH (optional): To usepbar
from any directory, move it to a directory included in your system's PATH, e.g.:sudo mv pbar /usr/local/bin/
pbar
works by taking a command as its first argument, followed by the arguments for that command.
pbar <command> [command_arguments...]
rsync
: Displays progress forrsync
operations.pbar rsync -a source/ destination/
dd
: Displays progress fordd
operations.pbar dd if=/dev/zero of=output.img bs=1M count=100
cp
: Displays progress forcp
operations.pbar cp large_file.zip /tmp/backup/
mv
: Displays progress formv
operations.pbar mv old_file.txt new_location/
curl
: Displays progress forcurl
downloads.pbar curl -O https://example.com/large_file.tar.gz
wget
: Displays progress forwget
downloads.pbar wget https://example.com/another_large_file.zip
You can customize the appearance of the progress bar by setting the BAR_STYLE
environment variable. If not set, it defaults to shaded
.
Available BAR_STYLE
options:
plain
(defaultpv
style)block
granular
shaded
Example:
To use the block
style:
BAR_STYLE=block pbar cp large_file.zip /tmp/backup/