在/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 (保存到文件中)
博客介绍了在Linux系统的/usr/local/bin中新建tree文件的方法,给出了具体代码。还说明了为tree文件添加执行权限的操作,以及使用tree命令一页页查看内容和将结果保存到文件的示例。
2493

被折叠的 条评论
为什么被折叠?



