Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / Perl

Tree view in linux

2.50/5 (12 votes)
22 Apr 2008CPOL 1   396  
This script displays tree view of the directory on linux terminal.

Sample Image - tree_view.jpg

Introduction

This script has been made to display tree view of directory in linux (like tree command in DOS). It scans directory recursively and then displays the tree view. Using "-width" argument tree view can be compressed or expanded. To display how to give arguments to script type "perl tree.pl" on the linux terminal. Follow the instructions displayed in the help. One need to have perl package installed in the system for this script to work. Default $expand_size = 5 and $max_width = 10. expand_size decides how much is space in between + and "name of directory or file". max_width is the maximum value of expand_size. User can increase default expand_size and max_width by editing tree.pl.

Visit my blog site at http://www.sandeep-vaniya.blogspot.com for some more interesting and useful stuff like

Java Utility for Mobile phone at http://sandeep-vaniya.blogspot.com/2008/04/good-stuff.html

Utility to lock-unlock your hard disk at http://sandeep-vaniya.blogspot.com/2008/04/about-locking-unlocking-capability-of.html

This perl script is also available at http://sandeep-vaniya.blogspot.com/2008/04/perl-script-for-directory-tree.html

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)