Prev / Next

2014-11-27 / Coreutils Viewer (cv)

メモ

https://github.com/Xfennec/cv

coreutils に含まれる cp, mv, dd, tar, gzip, gunzip, cat, grep, fgrep, egrep, cut, sort などの
コマンドの進捗を表示してくれるツール。


$ wget https://github.com/Xfennec/cv/archive/v0.5.1.tar.gz
$ gtar xvf v0.5.1.tar.gz
$ cd cv-0.5.1
$ make
$ ./cv --version
cv version 0.5
$ ./cv --help
cv - Coreutils Viewer
---------------------
Shows running coreutils basic commands and displays stats.
Supported commands: cp mv dd tar gzip gunzip cat grep fgrep egrep cut sort 
Usage: ./cv [-vqwmMh] [-W] [-c command]
  -v --version            show version
  -q --quiet              hides all messages
  -d --debug              shows all warning/error messages
  -w --wait               estimate I/O throughput and ETA (slower display)
  -W --wait-delay secs    wait 'secs' seconds for I/O estimation (implies -w, default=1.0)
  -m --monitor            loop while monitored processes are still running
  -M --monitor-continous  like monitor but never stop (similar to watch ./cv)
  -h --help               this message
  -c --command cmd        monitor only this command name (ex: firefox)


coreutils に含まれるコマンドが実行されていない場合

$ ./cv
No command currently running: cp, mv, dd, tar, gzip, gunzip, cat, grep, fgrep, egrep, cut, sort, exiting.


coreutils に含まれるコマンドが実行されてる場合

$ ./cv
[ 6047] grep /home/fumi/src/jetty/jetty-distribution-8.1.15.v20140411/javadoc/org/eclipse/jetty/http/class-use/HttpStatus.Code.html 0.0% (0 / 7.5 KiB)


とりあえず、cv -M で起動させておくとよさげ。

"-c" オプションで coreutils 以外のコマンドの進捗の確認もできる
(coreutils に含まれるコマンドは勝手にみつけてくれる)。

linux/fs.h を使っているため、Solaris では以下のような感じでビルドできない。

$ CC=/usr/bin/gcc make
/usr/bin/gcc -g -Wall -D_FILE_OFFSET_BITS=64 -c cv.c
cv.c:41:22: fatal error: linux/fs.h: No such file or directory
 #include <linux/fs.h>
                      ^
compilation terminated.
make: *** [cv.o] Error 1


via: A Great Tool To Show Linux Command Progress Like % , ETA
     http://linoxide.com/linux-command/tool-show-command-progress/

comments powered by Disqus