The mv team is going crazy

Here is a script, and I highlighted a block which, in my opinion, is causing a recent problem.

mv sourcefile targetfile > /dev/null  

I know that mv will overwrite by default without asking for confirmation if the destination file exists. Therefore, the script (see above) is correct.

mv: try to overwrite `targetfile', overriding mode 0644 (rw-r--r--)?

The only time a request asks for confirmation for overwriting is the -i option, which is not used in this case. This does not always happen. Appears from time to time

So why is this so?

This is my version of mv

mv (GNU coreutils) 8.12
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, David MacKenzie, and Jim Meyering.
+4
source share
2 answers

According to the manpage, the option -fhas the following goals:

       -f, --force
          do not prompt before overwriting
+4
source

. .

chmod a+w <directory>

rm -f targetfile mv.

, GHugo , -f

0

All Articles