cp

cp copy

cp [options] source destination

 

 

One of my favorite tricks for this (under Linux) is to find out the PID of the cp process (using ps | grep cp or similar), and then to look in /proc/$PID/fd/ and /proc/$PID/fdinfo/.

$ cp -r y z
^Z
$ ls -l /proc/8614/fd
lrwx------ 1 jander jander 64 Aug  2 15:21 0 -> /dev/pts/4
lrwx------ 1 jander jander 64 Aug  2 15:21 1 -> /dev/pts/4
lrwx------ 1 jander jander 64 Aug  2 15:20 2 -> /dev/pts/4
lr-x------ 1 jander jander 64 Aug  2 15:21 3 -> /home/jander/y/foo.tgz
l-wx------ 1 jander jander 64 Aug  2 15:21 4 -> /home/jander/z/foo.tgz

This will show you what files the process has open. If you want to see how far into the file the process is…

$ cat /proc/8614/fdinfo/3
pos:    105381888
flags:  0500000

the pos parameter is the position of the read (or write) pointer, in bytes.