Argument list too long - help

Smoot Carl-Mitchell smoot at tic.com
Wed Jun 10 19:06:35 UTC 2009


On Wed, 2009-06-10 at 20:00 +0100, Chris Jones wrote:
> On 10 Jun 2009, at 7:48pm, Carl Friis-Hansen wrote:
> 
> > I just discovered that ZoneManager has stored some 87000 png files  
> > in a
> > directory.  I have no use of them and wanted to remove them.
> > That turned out not to be so strait forward:
> >
> > carl at cjfh3:~$ rm Webcam_Pictures/*.png
> > bash: /bin/rm: Argument list too long
> > carl at cjfh3:~$
> >
> > How do I best come around this issue ?
> 
> 
> many ways
> 
>   > cd ~/Webcam_Pictures
>   > ls *.png | xargs rm
> 
> is one.

The ls *.png will not work.  Its argument list is also too long. You
have to use "find" instead to get the list of arguments to pipe to
xargs.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list