[Nottingham] cp and a progress/working indicator

Andy White andy at milky.org.uk
Fri Jun 14 08:50:17 UTC 2013


On Fri, Jun 14, 2013 at 09:43:37AM +0100, Jason Irwin wrote:
> This is a trivial question and it's probably in the man pages, but I
> can't see it.
> 
> Does "cp" have a progress option?  Like "rsync" does?
> I know about "-v", which is handy but on big files I have no idea if
> it's working or hung (I am haunted by the Windows demons that tell me;
> no output = yer request is screwed, pal).
> Doesn't have to be a % indicator or anything...just some clue that
> things are indeed working.
> Or is there some trick I could use to get one?  Somehow pipe "cp"
> through something.

Assuming this is linux, then:

Once you get the pid of the cp, you can cat /proc/<pid>/io to show
raw io stats, and you can look at which fd in ls -l /proc/<pid>/fd is your
destination and cat the corresponding /proc/<pid>/fdinfo/N.

There's also the package iostat.



More information about the Nottingham mailing list