How to prevent rm from reporting that a file was not found?

I am using rm within a BASH script to delete many files. Sometimes the files are not present, so it reports many errors. I do not need this message. I have searched the man page for a command to make rm quiet, but the only option I found is -f, which from the description, “ignore nonexistent files, never prompt”, seems to be the right choice, but the name does not seem to fit, so I am concerned it might have unintended consequences.

  • Is the -f option the correct way to silence rm? Why isn’t it called -q?
  • Does this option do anything else?

6 Answers
6

Leave a Comment