From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,dd9d6b75705fafda X-Google-Attributes: gidfee84,public From: Alex Nord Subject: Re: HELP with remove (rm) Date: 1997/02/14 Message-ID: <33048FE6.7286@jabil.com>#1/1 X-Deja-AN: 218837825 References: <3300ea4e.9049223@snews.zippo.com> To: nobody@nowhere.org Content-Type: text/plain; charset=us-ascii Organization: Jabil Circuit, Inc. Mime-Version: 1.0 Reply-To: alex_nord@jabil.com Newsgroups: comp.unix.osf.osf1 X-Mailer: Mozilla 3.0Gold (WinNT; I) Achachila wrote: > > Hi! > > Sorry but I am new to Digital Unix, could anyone tell me how can I rm > 1000 of files without getting Arg. list to long? > > I need to rm something like *96* > > Thanks for any help > > Achachila Following is a script I've had sitting around for quite a while. I've kinda nicknamed it 'rmsome'. With it, I can also remove files from, say, an entire month (rmsome Jan), or just a day (rmsome "Jan 21") because of the -l listing on ls. num=$RANDOM ls -l | grep "$1" | cut -c55- > /tmp/kill.$num while read i do rm $i done < /tmp/kill.$num rm /tmp/kill.$num