The GNU Coreutils manual for mv
says:
-f --force Do not prompt the user before removing a destination file.
However, this already seems to be the default behaviour for mv
, so the -f
option appears to be superfluous. E.g. in GNU Bash version 4.3.11:
$ ls -l
total 0
$ touch 1 2; mv -f 1 2; ls
2
$ touch 1 2; mv 1 2; ls
2
It seems unlikely the intention of the -f
flag is to override alias mv="mv -i"
, because there are several standard ways of overriding an alias (e.g. using \mv
) that would do this more concisely and in a way that is consistent across commands.
The manual notes that, "If you specify more than one of the -i, -f, -n options, only the final one takes effect," but it still seems unlikely the intention of the -f
flag is to override the -i
flag in general, because equivalent behaviour can be achieved by simply using mv
, which is much more concise and comprehensible than using mv -if
.
That being the case, what is the purpose of the -f
flag? Why does it exist?
mount
, for instance (though there are better examples). Do you really want to have to remember what the defaults are for every option, so you can determine which options you need to set? It's a GOOD THING to have options both for the default and the non-default, so you can explicitly set the option instead of needing to mentally keep track of what the default is. Something there is easier to remember than something not there.