Progress – A Tool to Monitor Progress for Commands in Linux (2016)
1–10 of 42 posts
Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#2Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#3Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#4 $ cp Test Test2
^T
load: 3.42 cmd: cp 86526 running 0.01u 4.36s
Test -> Test2 6%Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#5https://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 Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#6If 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 file descriptor number in the context of the process) that are either symbolic links to the actual file or to socket connection (or other data structures). Let's assume that source file has fd 3 (you get this information via ls -l /proc/1234/fd )
Then, after you can cat /proc/1234/fdinfo/3 and look at the pos value: that's the position of the cursor in the file.
It's ugly and unpractical, but it should work on every Linux systems featuring basic tools.
Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#7I 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…
Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#8With respect to cp and mv, I've found that rsync is often a good alternative for anything more than trivial moves and copies.
Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#9On 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%
Re: Progress – A Tool to Monitor Progress for Commands in Linux (2016)
#10Usually 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