'rm' Can not delete files

Ingo Hofmann ingo.hofmann at dont-panic.org
Tue Feb 7 22:40:43 UTC 2012


What helps me sometimes is wrapping it up:

for i in *; do rm $i; done

Best,
Ingo

P.S.:
Helps also with whitespaces in the filename where 'rm *' fails too.

On 07.02.2012, at 14:10 , Rares Aioanei wrote:

> On 02/07/2012 11:59 PM, Коньков Евгений wrote:
>> # rm *
>> /bin/rm: Argument list too long.
>> 
>> 
>> in this directory about 25000 files,
>> but actually there is only one argument to rm it is '*' sign.
>> 
>> Why rm get list of all files in directore instead of deleting one by one?
>> 
>> _______________________________________________
>> freebsd-questions at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>> 
> AFAIR, the shell expands * to every match , so from this point of view it is equivalent to the 25000 files. Try 'rm -f [a-d]*' , then [e-h]* or similar until you get them all.
> 
> Best,
> 
> -- 
> Rares Aioanei
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list