GNU bug report logs - #7775
rm -f emits no error message when deleting nonexistent file

Previous Next

Package: coreutils;

Reported by: Jeremy Hetzler <jeremyhetzler <at> gmail.com>

Date: Mon, 3 Jan 2011 15:55:01 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 7775-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Jeremy Hetzler <jeremyhetzler <at> gmail.com>
Cc: 7775-done <at> debbugs.gnu.org
Subject: Re: bug#7775: rm -f emits no error message when deleting nonexistent
	file
Date: Mon, 03 Jan 2011 18:06:12 +0100
Jeremy Hetzler wrote:
> rm normally produces an error when you delete a nonexistent file. However,
> under -f, you get no error message. I would argue this is a bug.
...
> 520 $ /bin/rm nonexistent
> /bin/rm: cannot remove `nonexistent': No such file or directory
>
> 521 $ /bin/rm -f nonexistent
>
> 522 $ rm --version
> rm (GNU coreutils) 8.5

Thanks for the report, but that's not a bug.
Rather, it is long-standing, documented and required behavior:

    $ rm --help                                                                  :
    Usage: rm [OPTION]... FILE...
    Remove (unlink) the FILE(s).

      -f, --force           ignore nonexistent files, never prompt




This bug report was last modified 14 years and 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.