Can I verbose output during a copy command processing?

160,086

Solution 1

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/

Solution 2

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/

Solution 3

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.

Solution 4

I propose :

watch du -sh /dsc/
Share:
160,086
Chen
Author by

Chen

Updated on September 18, 2022

Comments

  • Chen
    Chen almost 2 years

    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?

  • guy mograbi
    guy mograbi over 9 years
    Please add watch "find . | wc -l" as well. I found it better since your command only shows one level depth.
  • muru
    muru about 9 years
    Since this is just an improvement to an existing answer, consider suggesting an edit instead.
  • Orphans
    Orphans over 7 years
    someone mark this a correct answer
  • merv
    merv over 7 years
    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.
  • muon
    muon almost 6 years
    on mac terminal, this gives cp: illegal option -- -
  • muon
    muon almost 6 years
    although cp -rv works
  • Ali Nobari
    Ali Nobari over 5 years
    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.