20130809 cp over files without the prompt - plembo/onemoretech GitHub Wiki

title: cp over files without the prompt link: https://onemoretech.wordpress.com/2013/08/09/cp-over-files-without-the-prompt/ author: phil2nc description: post_id: 6237 created: 2013/08/09 09:50:42 created_gmt: 2013/08/09 13:50:42 comment_status: closed post_name: cp-over-files-without-the-prompt status: publish post_type: post

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.

Copyright 2004-2019 Phil Lembo