cp with force overwrite

by paul on April 13, 2009

I was recently trying to copy a directory over an existing one and kept getting prompted - asking if I wanted to overwrite existing files - even though I was using the force option:

cp -Rf dir1 dir2

I found the answer here - it was caused by an alias forcing the interactive mode.

Quick solution is to bypass the alias by an absolute reference to cp:

/bin/cp -Rf dir1 dir2

Leave a Comment

Previous post: Error executing script War: No such property: stagingDir for class: _Events

Next post: Redirecting javathinking.com to www.javathinking.com