On Fri, Apr 26, 2002 at 05:09:45PM -0700, Patrick Nelson wrote: > This may be really simple, but I just can't seem to get my hands around it. > How do I get a directory listing using ls (or some other command maybe). > All I want is the directories names (no files or .. or . ) and no other > information, just the directory names in the current directory (not > concerned with how the names are delimited). I'm pulling the directory > names into a script for processing.
ls -F | grep '/$' will give you a list of all the directories, but they will show up with a '/' at the end of the names. You could remove the slash with sed. Alternatively, you can use find: find . -maxdepth 1 -type d which will give you a list of all directories in the current directory, but they will also be prepended with a './', which you can again remove with sed. -- Anand Buddhdev Personal site: http://anand.org _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list