Re: [Q] Delete file get "parameter too long"

From: Harvey, Bruce T. (BTHarvey@LMUS.LEGGMASON.COM)
Date: Tue Apr 27 2004 - 08:45:12 EDT


1. Use the find command. But be absolutely certain either the directory
you specify or the directory you're in. This would als remove files in
lower directories, though, so be careful.

        Ex: find /mydir -type f -name "*somepattern*" -exec rm -f {} \;
-print

2. List the files into a temporary file, create a 'for' loop or 'while
read' loop, then remove one at a time.

        Ex: ls >/tmp/myfile
             for f in `cat /tmp/myfile`
             do
                  rm -f $f
             done

             -or-

             cat /tmp/myfile | while read f
             do
                  rm -f $f
             done

Bruce T. Harvey
Legg Mason Wood Walker, Inc.
Corporate Technology - Mgr. UNIX Engineering
11155 Red Run Blvd - Owings Mills, MD 21117-3256
(410) 580-7383 -------- BTHarvey@LeggMason.com
-----------------------------------------------------------

-----Original Message-----
From: bbb bb [mailto:mccux1@HOTMAIL.COM]
Sent: Tuesday, April 27, 2004 8:29 AM
To: aix-l@Princeton.EDU
Subject: [Q] Delete file get "parameter too long"

We have AIX 4.3.3 on RS6000. I tried to delte files and get "parameter too
long". I need change to that directory to delete it.
Does anyone know why and how to fix it?

The procedures I do:

$ rm /user1/dir1/*
ksh: /usr/bin/rm: 0403-027 The parameter list is too long.
$ ls -al /user1/dir1/*|wc -l
ksh: /usr/bin/ls: 0403-027 The parameter list is too long.
       0
$ cd /user1/dir1
$ ls -lt|wc -l
    1042
$ rm *
$ ls -al
total 232
drwxrwxrwx 2 informix sys 22016 Apr 27 07:00 .
drwxrwsrwx 16 informix sys 90624 Apr 27 06:01 ..

Thanks.

_________________________________________________________________
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage!
http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1/go/onm00200362ave/
direct/01/

IMPORTANT: The security of electronic mail sent through the Internet
is not guaranteed. Legg Mason therefore recommends that you do not
send confidential information to us via electronic mail, including social
security numbers, account numbers, and personal identification numbers.

Delivery, and timely delivery, of electronic mail is also not
guaranteed. Legg Mason therefore recommends that you do not send time-sensitive
or action-oriented messages to us via electronic mail, including
authorization to "buy" or "sell" a security or instructions to conduct any
other financial transaction. Such requests, orders or instructions will
not be processed until Legg Mason can confirm your instructions or
obtain appropriate written documentation where necessary.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:51 EDT