Thursday, 17 March 2011

cool tricks with pv

Blog come... blogs go... Im just keeping some notes here...

1) Simulate typing
echo "You can simulate on-screen typing just like in the movies" | pv -qL 10

2) Monitor progress of a command
pv access.log | gzip > access.log.gz

3) copy working directory and compress it on-the-fly while showing progress

tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz

4) dd with progress bar and statistics

dd if=/dev/sdc bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG

5) [re]verify a disc with very friendly output

dd if=/dev/cdrom | pv -s 700m | md5sum | tee test.md5

6) time how fast the computer reads from /dev/zero

pv /dev/zero > /dev/null


Cheers to UrFix's Blog

:)

No comments:

Post a Comment