Is there an easy way to list only directories under a given directory in Linux?
To explain better, I can do:
find mydir -type d
which gives:
mydir/src
mydir/src/main
mydir/bin
mydir/bin/classes
What I want instead is:
mydir/src/main
mydir/bin/classes
I can do this in a bash script that loops over the lines and removes previous line if next line contains the path, but I'm wondering if there is a simpler method that does not use bash loops.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…