Recently, I found about a nice tool for showing the progress when extracting a compressed tar file on the command line: pv. pv monitors the progress of data as it goes through a pipe, so we need to send the file to tar using a pipe:
$ pv file.tgz | tar xzf - -C target_directory
This will show elapsed time, percentage completed with a progress bar and an estimated time to completion (ETA), something like this
1.16MB 0:00:20 [6.06MB/s] [==================> ] 55% ETA 0:00:37
Some more info about pv and examples at: A Unix Utility You Should Know About: Pipe Viewer.
Nicer progress bar using dialog
The command above showed very useful, but I wanted to be able to show the progress of extraction using
dialog. This is an example script of a progress bar using dialog:
(Click here to read the rest of this entry)
I’ve been writing some simple BASH scripts lately (no, I’m not good with bash), and was looking for a method to get notified when certain parts of the scripts finished, I’ve found notify-send serves perfectly for this purpose, besides being used by Epiphany for notifying when a new message arrives
.
Get notify-send
# aptitude install libnotify-bin
Test it
$ notify-send Title Message
This will show a notification balloon on the top rigth corner of your screen with the indicated title and message. Really, it’s been really useful for my everyday use, I can start a batch process and go on with my other activities, then I receive a notification when the process finishes or requires my attention
.
A very simple example is to compile a big program such as alsa:
$ ./configure && make && notify-send "Ready to install"
Or a more elaborated and really nice one
.