PDA

View Full Version : Bash: Copy files without asking prompt



ryanrio95
March 1st, 2012, 05:27 PM
Hi.

This is absolutely beginner talk.
But i know that when i use cp -f it doesn't ask me if i want to overwrite.
It just overwrites. But i want to make this command faster by skipping the files that are already existing in the destination directory.
Does anyone know the option to add for this?

Regards.

winh8r
March 1st, 2012, 05:33 PM
enter:



man cp

for a full list of options when using the cp command with explanations of what each option does.

Hope this helps you

Vaphell
March 1st, 2012, 05:33 PM
maybe this

$ cp --help
...
-n, --no-clobber do not overwrite an existing file (overrides
a previous -i option)
...

ryanrio95
March 1st, 2012, 06:08 PM
Thanks, that should help me out.