Version info: [root@ega051000009 xml-cocoon]# rpm -q -f /bin/cp fileutils-4.0x-3 When used at the command line, cp always prompts for overwriting a file, regardless of whether the -f or --force switch is set or not, as shown. According to "info cp", the -f switch should disable interactive prompting. [root@ega051000009 xml-cocoon]# cp -f changes.xml /greenrd/ws2/xml-cocoon/ cp: overwrite `/greenrd/ws2/xml-cocoon/changes.xml'? y [root@ega051000009 xml-cocoon]# cp --force changes.xml /greenrd/ws2/xml-cocoon/ cp: overwrite `/greenrd/ws2/xml-cocoon/changes.xml'? y [root@ega051000009 xml-cocoon]# cp changes.xml /greenrd/ws2/xml-cocoon/ cp: overwrite `/greenrd/ws2/xml-cocoon/changes.xml'? n This bug does not occur on RedHat 6.2.
This is because by default cp is aliased to 'cp -i'. The behaviour of the GNU supplied fileutils has changed so tht cp -i -f still prompts.
And it's not a bug - the fileutils changelog states that they had to do it because POSIX demands it. The 'fix' is to get rid of the "cp='cp -i'" alias in your ~/.bashrc.
why rm -f works?