[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] Challenge: Prune a directory tree



On Oct 14, 2004, at 4:35 PM, Daniel Linder wrote:
  find . -depth -type d -exec rmdir {} \;

Wow. Unreal. I didn't know -depth until now.

On Oct 14, 2004, at 3:24 PM, Trent Melcher wrote:
http://www.stonehenge.com/merlyn/UnixReview/col16.html

Ya...

   Perl's File::Find       Command line
   -------------------     ----------------
   find()                  find ./
   finddepth()             find ./ -depth

   (perldoc File::Find)

If what I was doing was a lot more involved than 'rmdir {}' I'd use Perl instead of trying to string together some God awful -exec string on the command line.

Beauty! Thanks Daniel! Looks like several of us needed to learn the -depth trick!

j