[PLUG] One-liners to empty all files in a directory?

Michael Rasmussen michael at jamhome.us
Thu Aug 18 03:15:38 UTC 2011


On Wed, Aug 17, 2011 at 06:52:20PM -0700, Randal L. Schwartz wrote:
> >>>>> "Jameson" == Jameson Williams <jameson.h.williams at intel.com> writes:
> 
> Jameson> I haven't been able to get this one yet.
> Jameson> Challenge: A one-line statement (pipes okay, but explicit loops not) 
> Jameson> that empties all found files (as for debugging with /var/log,
> Jameson> perse).
> 
> In a single directory?
> 
> "rm *".
> 
> What's hard with that?

That's not:
michael at bivy:~/tme$ ls -l
total 0
-rw-r--r-- 1 michael michael 0 2011-08-17 20:14 a
-rw-r--r-- 1 michael michael 0 2011-08-17 20:14 b
-rw-r--r-- 1 michael michael 0 2011-08-17 20:14 c
-rw-r--r-- 1 michael michael 0 2011-08-17 20:14 d
-rw-r--r-- 1 michael michael 0 2011-08-17 20:14 e
michael at bivy:~/tme$ 

that's 

michael at bivy:~/tme$ ls -l
total 0
michael at bivy:~/tme$ 


> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> See http://methodsandmessages.posterous.com/ for Smalltalk discussion
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 

-- 
            Michael Rasmussen, Portland Oregon  
      Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/
Fortune Cookie Fortune du jour:
Dogs kill more humans than any animal except for other humans.
	~  Bruce Schneier



More information about the PLUG mailing list