明显的
ls -dR
不起作用。
我目前正在使用
find /path/ -type d -ls
但输出结果不是我需要的(子文件夹的普通列表)。
有什么办法可以解决吗?
OP没有说明他们想要什么格式的输出(除了 子文件夹的简单列表")。
[ 15:53. root@prod-2 /var]% ls -lDR | grep ':$' | head
.:
./account:
./cache:
./cache/coolkey:
./cache/fontconfig:
./cache/logwatch:
./cache/man:
./cache/man/X11R6:
./cache/man/X11R6/cat1:
./cache/man/X11R6/cat2:...
可以选择用"|sed -e 's/:$/' "删除后面的":",或者用"|awk '{printf("%-92s /n",$0)}' "等格式。