cp over files without the prompt

Whilst updating Apache Directory Studio this morning ran into the annoying cp confirmation prompt. Argh.

ApacheDirectoryStudio was misbehaving under the latest OpenJDK on Fedora 19, so I downloaded the newest version of ADS to see if that would work. It did. I had been running 2.0.0.v20120224, but once I overwrote it with 2.0.0.v20130628 all seemed to be well again (including the apparent squashing of the bug that caused ADS to fail to close prior connections in the same session).

While copying over the files I ran into the cp confirmation prompt for every file. Simply adding “-f” to the command line didn’t help.

An article on Red Hat mail lists summarized the various approaches to fixing this that have cropped up over the years. The last suggestion, being the simplest and least intrusive, is, of course, the correct one:

\cp -f * /path/to/old/files

That backslash (“\”) is the key. What it does is tell the shell to execute plain old cp, not the custom command alias cooked up by the O/S developers that actually triggers confirmation.

So there you go.

This entry was posted in Identity Management, System Administration, Systems Analysis on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).