Live data from Hacker News

Progress – A Tool to Monitor Progress for Commands in Linux (2016)

tecmint.com

31–40 of 42 posts

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#31
post #4

On macOS you can monitor the progress of many commands with Ctrl-T. With cp for example: $ cp Test Test2 ^T load: 3.42 cmd: cp 86526 running 0.01u 4.36s Test -> Test2 6%

SIGINFO is very useful. I make it a point to implement support for it whenever it makes sense. Wish Linux would get it.

Some GNU utils use USR1 instead. It's not ideal, but it gets the job done.

I'd also like to map ^T to `kill -USR1 ` on my machines, but didn't research it much.

> Sending an ‘INFO’ signal (or ‘USR1’ signal where that is unavailable) to a running dd process makes it print I/O statistics to standard error and then resume copying. [0]

[0] https://www.gnu.org/software/coreutils/manual/html_node/dd-i...

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#34
I had recently written a Python program (called watch.py) somewhat like the GNU watch [1] command (which user kjeetgill mentioned in another comment here).

[1] http://man7.org/linux/man-pages/man1/watch.1.html

A Python version of the Linux watch command:

https://jugad2.blogspot.in/2018/05/a-python-version-of-linux...

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#35
post #24

This is my super-simple progress indicator, called dots. I wrote it at least 12 years ago when I was on a slow terminal and wanted to know unpacking a tarball was still progressing (the verbose output would have taken too much bandwidth!). Now I copy it onto every new system I use. It prints one period (.) for every 1000 lines of text piped into it. It just shows that there is still activity, not progress, but often…

"pv" is a favourite of mine for single command progress indicators

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#36
post #6

I know what I am about to say is an absolutely ugly hack, but... If you cannot install non-standard software (example: customer owner, company operated RHEL boxes) you can get an idea of the current progress of cp/tar and similar programs by inspecting file-descriptor files in /proc. Assuming that you have a process (like cp) with pid 1234, then in /proc/1234/fd you will find files with a number (corresponding to the…

Thanks for the explanation, TIL :)

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#37
post #24

This is my super-simple progress indicator, called dots. I wrote it at least 12 years ago when I was on a slow terminal and wanted to know unpacking a tarball was still progressing (the verbose output would have taken too much bandwidth!). Now I copy it onto every new system I use. It prints one period (.) for every 1000 lines of text piped into it. It just shows that there is still activity, not progress, but often…

"pv" is a favourite of mine for single command progress indicators

Thanks, I didn't know that existed! I might have to cut a corner off my Unix guru card :)

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#39
post #38

Usually I have used pv. https://linux.die.net/man/1/pv cp pv source > target tar tar czf images.tar.gz image1 image2 image3 | pv > target gzip pv source | gzip > target.gz # or gzip

You mean: gzip target.gz

You are correct, thanks

Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)

#40
post #11
post #6

I know what I am about to say is an absolutely ugly hack, but... If you cannot install non-standard software (example: customer owner, company operated RHEL boxes) you can get an idea of the current progress of cp/tar and similar programs by inspecting file-descriptor files in /proc. Assuming that you have a process (like cp) with pid 1234, then in /proc/1234/fd you will find files with a number (corresponding to the…

This is just fantastic. I had all the bits of information in my head to be able to do this, but never connected the dots. Not ugly at all!

Thanks mate :)
Post reply on HN