There's a program called tree at /mama.indstate.edu/users/ice/tree/ that if you run it with -d command it print only directories and if you don't like the "pretty" way it prints output you can change it since it's a fairly simple program.For a script I'm writing I need to list all the directories and sub directories under a certain directory. Say I've got a directory called /usr/local and I told this script run there it would list something like
bin doc etc games include lib libexec sbin share src
share:
info man
it does src:
foo bar
The formatting isn't too important, it just seems there should be a straight forward way to do this with ls or find, but I'm not finding anything that straightforward. Does anyone have any suggestions, even if they are not too straightforward I'm interested.
Bryan
also if you really wanted to write your own script and didn't like find . -type d then you could simply traverse each directory recursively and do an "ls -d */" in each directory and that would use ls style formating.
-chris
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
