On Mon, 20 May 2002, Henning, Brian wrote:

> good point
> i was trying to go from memory...
> bad idea
> 
> -----Original Message-----
> From: Gordon Messmer [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 20, 2002 10:03 AM
> To: [EMAIL PROTECTED]
> Subject: RE: bash: /bin/rm: Argument list too long
> 
> 
> 'ls -l *' will fail with the same error as 'rm -f *'.  Just use:
> 
> ls | xargs rm -f
> 
> Isn't xargs covered in RHCE training and evaluation?  :)

if you're trying to remove hundreds or thousands of files *selectively*,
then xargs is the way to go -- perhaps a wildcard pattern like *.jpg
or some such.

if you *truly* want to empty a directory, why not just cd up one level
and remove the directory with:

$ rm -rf <dirname>

this has the advantage of getting rid of all of the hidden objects as
well, which normal wildcards don't.  you can always "mkdir" the directory
and put it back if you really need it.

rday



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to