I learned that -i option is interactive mode and -f option is force model in rm command.
When I tried both options
rm -if test.txt
it did not ask me and just deleted it which means -f option overrode -i option.
Of course, I would not use options -i and -f at the same time in real life. But I wonder if there is a priority if two contradictory options are used at the same time.
I tried this in Ubuntu 22.04.
rm -fi test.txt
to see what happens. The options are read in order and the last option's functionality is what is enforced. And you might not plan on using this in real life but many paranoid people aliasls
tols -i
and then might be caught byls -f foo
.info coreutils 'rm invocation'
) notes under-f
that it will "Ignore any previous ‘--interactive’ (‘-i’) option."cp -f
doesn't override-i
: unix.stackexchange.com/questions/744420/…