[olug] Challenge: Prune a directory tree

Daniel Linder dan at linder.org
Thu Oct 14 21:42:50 UTC 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<quote who="David Walker">
>  find . -type d -empty -exec rmdir {} \;
> works. but generates an error for each file deleted
> not recursive.  must be run repeatedly until complete

If you add the "-depth" option, then it will work from the farthest
subdirectory backward and not require a second run to cleanup.

Dan

- - - - -
"I do not fear computer,
I fear the lack of them."
 -- Isaac Asimov

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBbvLaNiBNyqUzGb8RAog1AJ434p0GNbmWlKVHVbS+Vveox5lEkgCfbu+t
aqtvgewIvYullkHtCGNPGR0=
=SSa7
-----END PGP SIGNATURE-----



More information about the OLUG mailing list