65.9K
CodeProject 正在变化。 阅读更多。
Home

Linux 中的树形视图

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.50/5 (11投票s)

2006年12月30日

CPOL
viewsIcon

52336

downloadIcon

414

此脚本在 Linux 终端上显示目录的树形视图。

Sample Image - tree_view.jpg

引言

此脚本旨在显示 Linux 目录的树形视图(类似于 DOS 中的 tree 命令)。它递归扫描目录,然后显示树形视图。使用“-width”参数可以压缩或展开树形视图。要在 Linux 终端上查看如何向脚本传递参数,请键入“perl tree.pl”。请遵循帮助中显示的说明。要使此脚本正常工作,系统需要安装 Perl 包。默认的 $expand_size = 5,而 $max_width = 10。expand_size 决定了“+”和“目录或文件名”之间的空间大小。max_width 是 expand_size 的最大值。用户可以通过编辑 tree.pl 来增加默认的 expand_size 和 max_width。

请访问我的博客站点 http://www.sandeep-vaniya.blogspot.com,获取更多有趣且有用的内容,例如:

手机 Java 工具:http://sandeep-vaniya.blogspot.com/2008/04/good-stuff.html

锁定和解锁硬盘的工具:http://sandeep-vaniya.blogspot.com/2008/04/about-locking-unlocking-capability-of.html

此 Perl 脚本也可在 http://sandeep-vaniya.blogspot.com/2008/04/perl-script-for-directory-tree.html 获取。

© . All rights reserved.