'rm' Can not delete files

CK ruletko at gmail.com
Tue Feb 7 22:35:29 UTC 2012


Êîíüêîâ Åâãåíèé 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?

Short answer: this is not Windows.

Long answer: shell does wildcard expands, therefore rm gets about 25000 
arguments of expanded '*'. Try

find ./ -type f -delete

Thanks,
CK


More information about the freebsd-questions mailing list