Remove file without asking

How can I remove a file without asking the user if he agrees to delete the file? I am writing shell script and use rm function, but it asks "remove regular file?" and I really don't need this.


Solution 1:

You might have rm aliased to rm -i so try this:

/bin/rm -f file.log

To see your aliases you can run alias.

Solution 2:

The force flag removes all prompts;

rm -f {file}

Solution 3:

May the force be with you - rm -f