在/usr/local/bin中新建一tree文件,将以下代码拷入:
然后:
chmod 0755 tree
tree /mnt/cd1 | more (一页页查看)
tree /mnt/cd1 > cd1.txt (保存到文件中)
filez=`echo $1 | sed -e 's/-d/-type d/g' -e 's/-f//g'`
find $filez -print | sort -f |
sed -e "s,^${1-.},," /
-e "/^$/d" /
-e "s,[^/]*//([^/]*/)$,/`-----/1," /
-e "s,[^/]*/,| ,g"
然后:
chmod 0755 tree
tree /mnt/cd1 | more (一页页查看)
tree /mnt/cd1 > cd1.txt (保存到文件中)