linux查看所有目录的shell脚本

LINUX系统运维技术交流群:4930609

#!/bin/sh
# dtree: Usage: dtree [any directory]
dir=${1:-.}
(cd $dir; pwd)
find $dir -type d  -print | sort -f | sed -e "s,^$1,," -e "/^$/d" -e "s,[^/]*/([^/]*)$,----1," -e "s,[^/]*/,| ,g"

你可能感兴趣的:(linux,shell,查看目录)