64

Situation: If I entered a copy command like cp -rf /src/ /dsc/ then I am waiting several minutes for copy large directories. I forgot to put -v flag to verbose an output, Can I do it during copying?

5 Answers 5

131

This question seems to be old, but for the cp command you've got the --verbose option.

So the command works as follows:

cp --verbose -rf /src/ /dsc/
5
  • 4
    someone mark this a correct answer
    – Orphans
    Commented Nov 23, 2016 at 20:04
  • 9
    This is ideally what one should have done, but the point of the question was, what can you do to monitor the copy progress if you forgot to do this for a large operation.
    – merv
    Commented Dec 23, 2016 at 4:08
  • 1
    on mac terminal, this gives cp: illegal option -- -
    – muon
    Commented Jul 19, 2018 at 17:54
  • 6
    although cp -rv works
    – muon
    Commented Jul 19, 2018 at 18:11
  • 4
    cp -v -r will indicate that you want to display files being copied (as specified by -v), and -r will indicate that you want to recursively copy files, which will be needed if you are copying any sub-directories.
    – Ali Nobari
    Commented Jan 4, 2019 at 6:22
46

No you can't, but you could use the watch command to look at the destination directory to see how the process is progressing, eg.

watch ls -l /dsc/
2
  • 5
    Please add watch "find . | wc -l" as well. I found it better since your command only shows one level depth. Commented Jan 7, 2015 at 8:29
  • How to deal with space in the path ? usual " " , ' ' or escaping \ doesn't seem to to work for watch ls -l /path with spaces/
    – Greenmarty
    Commented Apr 8 at 8:37
16

You could always use rsync instead, you'll atleast get to see the files that are being copied

rsync -rva /src/ /dst/

Of-course this only works before you start copying as an alternative to cp. The good news is though that rsync will only copy the files it needs to so you can kill your long-running cp command run the rsync command and it will pick up where cp left off.

8

I propose :

watch du -sh /dsc/
1
  • 5
    Since this is just an improvement to an existing answer, consider suggesting an edit instead.
    – muru
    Commented Jun 20, 2015 at 16:21
2

I recommend to use Midnight Commander in case when you need to see a progress of files copying.

  1. Install Midnight commander:

    apt-get install mc
    
  2. Open it:

    mc
    
  3. On first panel open source, on second - destination. Start copying using "F5".

MC will display nice and informative progress dialog.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .