A detailed run down of one command mentioned from one linux tips link posted here, was the linux command tree.
Man says:
Tree is a recursive directory listing program that produces a depth indented listing of files. Color is supported ala dircolors if the LS_COLORS environment variable is set, output is to a tty, and the -C flag is used. With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn. Upon completion of listing all files/directories found, tree returns the total number of files and/or directories listed.
This is a handy little utility to display tree view of directories. An overview of how files and directories are expanded and traversed can be misleading and confusing when we are referring to thousand of files and folders. Tree comes as a handy tool to peruse those deep directory tree structures and files, especially when someone is trying to hide something from you.
With my fresh virtual Fedora 7 box, I have managed to count all directories and display them in tree view from it. By default installation, Fedora has more than 11,600 directory folders.
INSTALLATION
====================
In case, tree is not installed from your current Fedora box, here's a quick yum install howto# yum -y install tree
TREE USAGE
====================
Here are more parameter sample using Tree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To display files and directories in a tree view mode# tree
To display directories only would be like# tree -d
Sample output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|-- [apache apache ] ./LICENSE.txt
|-- [apache apache ] ./_install.php
|-- [apache apache ] ./_upgrade.php
|-- [apache apache ] ./admin
| |-- [apache apache ] ./admin/index.php
| |-- [apache apache ] ./admin/js
| | |-- [apache apache ] ./admin/js/AmiJS.js
| | |-- [apache apache ] ./admin/js/ajax_editing.js
| | |-- [apache apache ] ./admin/js/greybox.js
| | |-- [apache apache ] ./admin/js/lightbox.js
| | |-- [apache apache ] ./admin/js/plogger.js
| | `-- [apache apache ] ./admin/js/prototype.js
| |-- [apache apache ] ./admin/plog-admin-functions.php
| |-- [apache apache ] ./admin/plog-admin.php
| |-- [apache apache ] ./admin/plog-feedback.php
| |-- [apache apache ] ./admin/plog-import.php
| |-- [apache apache ] ./admin/plog-manage.php
| |-- [apache apache ] ./admin/plog-options.php
| |-- [apache apache ] ./admin/plog-rpc.php
| |-- [apache apache ] ./admin/plog-themes.php
| |-- [apache apache ] ./admin/plog-thumb.php
| |-- [apache apache ] ./admin/plog-thumbpopup.php
| `-- [apache apache ] ./admin/plog-upload.php
|-- [apache apache ] ./captcha.ttf
|-- [apache apache ] ./css
| |-- [apache apache ] ./css/admin.css
| |-- [apache apache ] ./css/gallery.css
| |-- [apache apache ] ./css/greybox.css
| |-- [apache apache ] ./css/lightbox.css
| `-- [apache apache ] ./css/tabs.css
|-- [apache apache ] ./dynamics.js
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To view and display every file and folders including hidden ones in a tree mode display would be
# tree -a
To view files with UID, GUID, filesize, file location would be like so# tree -ugfs
Sorted view of tree display is also possible by using tree parameters like
reversed sorting order# tree -ugfsr
sorted by modification time# tree -ugfst
To view and display all files and directories with UID and GID# tree -gd
To use tree with enabled colorization would be# tree -C
You can notice that using tree parameters, you can search files in a tree view mode of display using tree from command line terminal. Remember that these results can be combined further using other linux command.
Using linux command tree combined with grep would create another alternative way on grep'ing all files that has a modification time stamp of this month, September.# tree -D | grep Sep
Alternatively, using tree to search or files and folder owned by a particular user or group ID like so# tree -ugf | grep 'root\|user1'
Since tree traverses director folder, the depth of directory tree can also be specified like so# tree -L 2
which traverses 2nd level down directories.
Another nice feature of tree linux command is that it can generate output in HTML file format with reference to base. This is done like so# tree -H 'http://yourhost.domain.com' > index.html
Here's a sample of the generated tree view in web page file format:
Here's a sample screenshot of tree output from command line:
Enjoy.
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2008
(2301)
-
▼
August
(1065)
- HOWTO: Managing Active Directory Users Under Linux...
- ATI R500: Mesa vs. Catalyst Benchmarking
- Wish list: 10 improvements for KDE 4.2
- LyX 1.6 is ready for release
- Make etexts pretty with GutenMark
- Hans Reiser Sentenced to 15-to-Life
- Novell Gets Close to Linux Foundation, Microsoft G...
- AXFS, Advanced Execute In Place Filesystem
- Microsoft Breaks IE8 Interoperability Promise
- Where the Linux laptops live
- Another Reason to Avoid Samsung, Microsoft and Nik...
- FreeBSD - A better chioce for the Open Desktop?
- Preventing Brute Force Attacks With Fail2ban On Fe...
- Interview: Andy Hertzfeld
- Nepomuk, KDE To Introduce the Semantic Desktop
- Nvidia 55nm Parts Are Bad Too
- Lenovo Demands Vow of Silence From Windows Wantaway
- Gerald Carter of Likewise talks about LDAP for Lin...
- Track your investments with Grism
- Android Market Debuts - Now Let's See Some Phones
- Distribution Release: Kiwi Linux 8.08
- What the FSF is doing Wrong
- EVDO and VoIP for remote audio transmission
- InformationWeek: Linux Foundation’s Collaboration ...
- Behind the Doors of the Free Software Foundation
- Dell Unveils New Vostros With Ubuntu
- Wikis in Education: Teaching Students to Share Kno...
- Quebec sued for ignoring Free Software
- The A-Z of programming languages: Python
- Thomas Vander Stichele: mach 0.9.4 ‘Maroc’ is rele...
- Thomas Vander Stichele: Congrats
- Automatic backup for sporadically connected client...
- Distribution Release: Turbolinux 12
- Flock Social Networking Web2.0 Browser in openSUSE
- Create Time-availability Maps with Perl and Google...
- Run emacs from init
- Development Release: PC-BSD 7.0 Beta 1
- Development Release: Pardus Linux 2008.1 Beta
- Linux Jumps To 13.4 Percent Of The Stalling Server...
- An open letter to Barack Obama and the DNC (or, ch...
- Greens urge end to software patents
- Developing For the Embedded Linux Nokia N810
- Running A File- And Print-Server With eBox On Ubun...
- Behind the doors of the Free Software Foundation
- Linux Foundation announces end user summit
- Eco Innovation in the Datacenter — A Slide Deck by...
- Interview with Tom Wickline, of the Bordeaux Project
- Can Open Source Replace Microsoft Exchange?
- BSD Job Trends
- Ignoring open source will put companies at a serio...
- Make etexts pretty with GutenMark
- LyX 1.6 is ready for release
- Linux Systems Being Hit By SSH-Key Attacks
- Debating the Firefox SSL Certificate
- Online Encyclopedia Shell Script For Linux And Unix
- Taking the Pulse of the Eclipse Ecosystem
- Astaro: Tapping the Channel for Security Revenue
- A Real Space Oddity Arrives at PC Pro
- The Problem With Open-source Revenue Models
- Four Twitter clients for Linux
- Nettop is "almost fanless"
- Vista FUD?
- Indywiki: Visual browser for Wikipedia
- 10 "Really Cool" Icon Sets for Ubuntu/GNOM...
- Psystar Responds to Apple Suit, Will Countersue
- Is There a Future for UltraSPARC Workstations?
- Acetoneiso2 - A Full Feature Rich Image/ISO Tool F...
- VisionTek Radeon HD 4870 X2 2GB
- How the bad documentation hurts GNU/Linux.
- Software Patents Riot Spreads to Four Continents
- New Version of Xen Hypervisor Hits the Streets
- Mozilla Introduces New Ubiquity Mashup Machine
- SSH Key-based Attacks
- Versioned MySQL Backups with Bazaar
- Penguins Linux Ad (YouTube video)
- KMess - MSN Messenger Client for KDE in openSUSE L...
- Voiceroute execs talk about going (mostly) open so...
- Inside the SFLC's "Practical Guide to GPL Comp...
- Space Cube - The World's Smallest Linux PC
- Sun for Sale?
- Be a Productive Linux User
- Cisco buys PostPath, targets Microsoft Exchange
- Easy file uploads with Droopy
- Development Release: Debian Live 5.0 Beta 1
- Moving LVM volumes to a different volume group
- Novell and Microsoft: Stop with the FUD already
- Anatomy of Linux Dynamic Libraries
- 5 Factors Making Ubuntu Server Business Ready
- 10 Fundamental Differences Between Linux and Windows
- Tailf - watch the linux log file grows
- Linux under attack: Compromised SSH keys lead to r...
- News to know: Psystar vs. Apple; WGA; Linux under ...
- One Less Windows User
- Development Release: SimplyMEPIS 8.0 Beta 1
- Be a Productive Linux User
- PostPath: Enterprise-strength open source alternat...
- RDesktop - remote desktop howto
- HowTo: Install Linux Hardware Browser
- RDesktop - remote desktop howto
- Interview With Kris Moore, PC-BSD Lead Developer
-
▼
August
(1065)
Sunday, August 24, 2008
Tree view of directories and file listings from command line
Posted by VeRTiTO at 9:18 PM
Labels: Linux News
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment