Main Content

Displaying a directory or file system tree - Linux

Archive - Originally posted on "The Horse's Mouth" - 2011-04-22 05:30:31 - Graham Ellis

How can you display your whole file tree on a Linux system? With the tree command!

|-- abo
|-- access_log
|-- adarrivals.txt
|-- adhoc_private
|   |-- adhoc.conf
|   |-- businesslogic.inc
|   |-- page_layout.htp
|   |-- sampledata.sql
|   |-- sqlwrapper.inc
|   `-- webhelpers.inc
|-- backups
|   |-- emma
|   |-- net.cgi.tgz
|   |-- net.html.tgz
|   |-- net.other.tgz
|   |-- nettouk.sql
|   |-- nettouk.sql.gz
|   `-- nfr
|       |-- accesslog_nfr.co.uk_4_24_2010
|       |-- perly
|       `-- snapshot
|-- batch
|   |-- ilog.php
|   |-- perl_web_anal
|   `-- php_web_anal
|-- booksonly.sql

• defaults to current directory. You may specify 1 or more directory names
• lots of options - I like -s to give sizes for each file
• many other options are the same as ls -a, -F etc
&bull full man page available ...(plenty of online copies such as [here].