bug#43657: rm does not delete files

2020-10-15 Thread Bob Proulx
close 43657
thanks

Paul Eggert wrote:
> On 9/27/20 8:58 PM, Amit Rao wrote:
> > There's a limit? My first attempt didn't use a wildcard; i attempted to 
> > delete a directory.
> 
> 'rm dir' fails because 'rm' by default leaves directories alone.
> 
> > My second attempt was rm -rf dir/*
> 
> If "dir" has too many files that will fail due to shell limitations that
> have nothing to do with Coreutils. Use 'rm -rf dir' instead.

The only reason I can guess that rm -rf dir/* might fail would be
argument list too long.  Which has an FAQ entry.  I feel confident
this was the problem you experienced.


https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Argument-list-too-long

In any case in order to establish the background it is necessary to
post command that you used exactly and then also the error message
that resulted.  Without that information exactly it is not possible to
establish the root cause of the behavior, if it is a bug, or if it is
kernel behavior.

Also if rm were to fail then extremely useful would be strace
information so that we could see the exact reason for the failure.

If this is the ARG_MAX limitation then it does not need rm to
reproduce the issue.  One can use any command.  Using echo should be
safe enough.

echo dir/* >/dev/null

In any case the suggested strategy of using "rm -rf dir" is very good
and very simple here.  It avoids that problem entirely.

Because I feel very confident that the issue is the kernel limitation
of ARG_MAX I am going to close this ticket.  However if you have
further information please reply and add it to the ticket.  It can
always be opened again if further information points to a bug to be
tracked.

Bob





bug#43657: rm does not delete files

2020-09-28 Thread Paul Eggert

On 9/27/20 8:58 PM, Amit Rao wrote:

There's a limit? My first attempt didn't use a wildcard; i attempted to delete 
a directory.


'rm dir' fails because 'rm' by default leaves directories alone.


My second attempt was rm -rf dir/*


If "dir" has too many files that will fail due to shell limitations that have 
nothing to do with Coreutils. Use 'rm -rf dir' instead.






bug#43657: rm does not delete files

2020-09-27 Thread Paul Eggert

On 9/27/20 1:00 PM, Amit Rao wrote:

rm /path/*

does not delete files if there are a lot (say 2000) of them in a single
directory


What does the command do instead?

There is a limit as to how many arguments you can pass to 'rm'. If that's what 
you ran into, it's a problem with your kernel or your shell, not with 'rm'.






bug#43657: rm does not delete files

2020-09-27 Thread Amit Rao
rm /path/*

does not delete files if there are a lot (say 2000) of them in a single
directory

version is 8.32 on ubuntu 20.04