This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bash: /usr/bin/rm: Argument list too long


Hi,

If I try to rm many files, or fewer files with long names I get "bash:
/usr/bin/rm: Argument list too long". Can anyone tell the limits?

Is the solution something like "for file in * ; do rm $file ; done"?

/Morten

The directory is empty:
mkj008@mcmkj01w /tmp
$ ls

mkj008@mcmkj01w /tmp

1000 files named f1,f2,f3,.. is ok:
mkj008@mcmkj01w /tmp
$ for (( i=1 ; $i<=1000 ; i=$i+1 )) ; do echo >f$i ; done

mkj008@mcmkj01w /tmp
$ rm *

10000 files named f1,f2,f3,.. is not ok:
mkj008@mcmkj01w /tmp
$ for (( i=1 ; $i<=10000 ; i=$i+1 )) ; do echo >f$i ; done

mkj008@mcmkj01w /tmp
$ rm *
bash: /usr/bin/rm: Argument list too long

Delete the files with windows:
mkj008@mcmkj01w /tmp
$ cmd
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

D:\cygwin\tmp>del /q *

D:\cygwin\tmp>exit

1000 files with long names is not ok:
mkj008@mcmkj01w /tmp
$ for (( i=1 ; $i<=1000 ; i=$i+1 )) ; do echo
>ffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff$i ; done

mkj008@mcmkj01w /tmp
$ rm *
bash: /usr/bin/rm: Argument list too long

same thing for ls:
mkj008@mcmkj01w /tmp
$ ls *
bash: /usr/bin/ls: Argument list too long

(See attached file: cygcheck.out)

Attachment: cygcheck.out
Description: Binary data

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]