Results 1 to 3 of 3
Is there a method in which I can list all the directories under root to a text file ?
I've tried ls -R but cannot tie this in the -d ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-13-2003 #1Just Joined!
- Join Date
- May 2003
- Posts
- 15
ls command --> capturing data
Is there a method in which I can list all the directories under root to a text file ?
I've tried ls -R but cannot tie this in the -d to show me just the directories...
thanks
mike
- 05-13-2003 #2Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
-d doesn't make ls only list directories. It makes ls list directory names found on the command line instead of recursing into them.
I'm not sure exactly what you want to do, but I'm guessing that what you want is this:
[code]find / -type d -maxdepth 2 >file{/code]
- 05-13-2003 #3Just Joined!
- Join Date
- May 2003
- Posts
- 15
Thank you...
Once again LinuxForums to the rescue.....
feel slightly piss*ff though
- I would never have known that.......
thanks for your help....


Reply With Quote
