English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

is there a command in Unix (something like ls -"X") to list the directories and all subdirectories.
While ls -d does this, i want the full roots of the folder.
I cannot find a way to do this.

my intended result would look like this...
/home/toodles/dir1
/home/toodles/dir2
/home/toodles/dir2/subdir

Thanks in advance,

2007-08-10 03:19:22 · 1 answers · asked by toodles_1399 1 in Computers & Internet Programming & Design

im looking for Every single directory listing...

2007-08-10 03:34:33 · update #1

McFate...Excellent answer...exacltly what i was looking for...i just substitute * with directory...you saved me man...

2007-08-10 03:37:12 · update #2

1 answers

You could do:

find [directory] -type d -print

As long as you list the full path for [directory], it will be shown on each individual entry.

Example:

# find /home/oracle -type d -print

/home/oracle
/home/oracle/.kde
/home/oracle/.kde/Autostart
/home/oracle/scratch
/home/oracle/bin

This prints the top-level directory as well (/home/oracle in this case). If you want to skip that, add "-mindepth 1" to the arguments:

find [directory] -mindepth 1 -type d -print

2007-08-10 03:24:24 · answer #1 · answered by McFate 7 · 1 0

fedest.com, questions and answers