Seeing the forest with tree

In Full View

Article from Issue 163/2014
Author(s):

The tree command can provide a clear view of all your files and directories and offers a few advantages over the usual ls command.

The tree command [1] is a tool that I'd overlooked until recently. After trying it for several weeks, however, I am starting to prefer its tree-like display of directories and files to the plain lists generated by ls.

Part of the reason is that, in these GUI-oriented days, even a directory tree made with ASCII characters is more comfortable than no structural display at all. The functional differences between tree and ls are minimal. The two commands share a few options, such as -a for displaying all files, and even when the options are different, the functionality remains similar. The largest exception I have noticed is that ls offers an option for the number of columns in which to display results; the tree display makes a single column unavoidable.

You have to look closely to see the differences, but tree is consistently more versatile, starting with, unlike ls, recursion. By default, tree displays all files in all subdirectories.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Colorful lsd

    A revamp of ls, lsd offers color coding plus revised options relevant to the modern computer.

  • Ncdu

    Ncdu adds some GUI-like features to the classic du command.

  • Workspace: TreeLine

    The hybrid nature of TreeLine means it offers more than your typical information manager. An outliner as well as a database, it allows you to sort and store all kinds of data with ease.

  • New Commands for Old Purposes

    As the standard core Linux commands have become more complex due to revisions, new commands have risen to take their place. Bruce looks at seven of these modern commands, plus a terminal emulator.

  • Agedu

    Agedu helps you clean up your hard drive by identifying old files. Free up wasted space instead of creating wasted time.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News