Avatar of tonelm54
tonelm54
 asked on

CP

Good evening,
Im a newbie with linux, and Ive figured out I can do "CP -R" to copy all files and directories, which works great, but if Im doing several Gb, I have no idea how far its got, or if its failed.

Is it possible to add a parameter in to show me which files its copying/copied, and maybe the progress of the current file?

On another question, is it possible to tell it to skip files if they exist already, or overwire if it does exist.

Thank you
Linux

Avatar of undefined
Last Comment
Tintin

8/22/2022 - Mon
Hugh McCurdy

I don't know any way cp will show progress.  You might want to look at the -a option.

To not overwrite exisitng files, use -n.  You might also want to look at -u.

See http://linux.die.net/man/1/cp
Hugh McCurdy

I'm not sure what you want with overwrite if they exist.  I think you want -f.  Again, see the man page at http://linux.die.net/man/1/cp
Tintin

What you want to use is rsync, eg:

rsync -av --stats --progress /source/dir /dest/dir
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Darr247

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Hugh McCurdy

I'd like to note that running at the #, especially for commands you don't understand, is a bad idea, especially for a newbie unless it's a "sandbox" system that you are willing to reload (as people did a lot in the old days of Linux).
Tintin

You are still much better off to use rsync.   For your purposes it will be way quicker and use much fewer resources.