toby 0 Report post Posted February 18, 2009 (edited) I want to get the name of every folder but not any files in one volume, on Mac OSX 10.5.6. The best idea I can think of is some mix of ls/find and grep/awk, but even with google and man I can't work much out. I got to ls -Rl and awk '{ print $NF }' > file but they don't work together well. Any ideas? It can be a program, I just looked for unix commands first. Edited February 18, 2009 by toby (see edit history) Share this post Link to post Share on other sites
yordan 10 Report post Posted February 18, 2009 If it's pure Unix or Linux, I would try the following : find . -type d -print"find" will look for everything starting from the current position (".") in order to display it ("-print"), provided that it's type ("-type") is "d" (directory).I just tried it on my Unix system and it works fine. Share this post Link to post Share on other sites
toby 0 Report post Posted February 19, 2009 Ty, perfect. I shall learn about find, it's new to me. Share this post Link to post Share on other sites
yordan 10 Report post Posted February 19, 2009 Ty, perfect. I shall learn about find, it's new to me.I use "find" very often.for instance, if you want to perform a backup of a given folder and put it on your tape, you use find this way :find . -print |cpio -omBdv >/dev/rmt0And if you want to copy the whole content of your folder to the remote resource which is nfs-mount on /mnt, use the following :find . -print |cpio -pmdulv /mnt/myfolderWhich means that you have to simultaneously learn "find" and "cpio" syntax... Share this post Link to post Share on other sites