Re: rm can accidentally delete dirs

"Alfred M. Szmidt" <[email protected]>
Newsgroups gmane.comp.gnu.fileutils.bugs
Message-ID <[email protected]>
   rm *f t*    should delete '-rf' and the  test file,
   leaving the directory, however, it interperates -rf as
   arguments, deleteing the folder and its contents. (It
   also leaves the -rf file).

Not a bug.  Wildcards get expanded by the shell, thus what you are
typing (i.e. what the shell is seeing) is "rm -rf testdir".  So to be
sure that you want to delete the directory -rf to, type "rm -- *f", or
some such.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.