Please read the INSTALL file for installation instructions, particularly if
you are installing on a non-Linux machine.
This is a handy little utility to display a tree view of directories that
I wrote some time ago and just added color support to. I've decided that
since no one else has done something similar I would go ahead and release
it, even though it's barely a 1st year CS student hack. I've found it damn
handy to peruse a directory tree though, especially when someone is trying to
hide something from you.
The main distribution site for tree is here:
Backup GIT sites are:
Old site for as long as it lasts:
If you don't like the way it looks let me know how you think it should be
formatted. Feel free to suggest modifications and additions.
Thanks go out so the following people who have helped bring tree to the
pinnacle of perfection that it is: ;)
- Added HTML output (-H).
- Added options -o, -L and -R.
- Added -S option to print ASCII graphics lines for use under linux
console when an alternate console font has been selected (might also
work under DOS telnet).
Guido Socher (and others)
- Made tree more portable. Should compile under solaris.
- Discovered bug where tree will segmentation fault on long pathnames.
- Discovered in -L argument processing.
- Discovered problem with recursive symlink detection
- Suggested option to remove file and directory report at end of tree
- Spotted memory over-allocation bug in read_dir().
- Submitted several patches to fix various memory leaks.
- Reported that Tru64 defines TRUE/FALSE in sys/types.h (OSF1 standard?)
- Found bug in tree that caused it to seg-fault if 50 file arguments where
given and directory coloring was turned on.
- Discovered tree crashed on missing arguments.
- Discovered that tree did not properly encode characters in filenames
when used as URLs when using the -H option.
- Fixed issue with --charset option processing.
- Pointed out that tree did not list large files.
- Submitted patch which fixed a compiler issue and cleaned up HTML and CSS
code, applied CSS to all output, and fixed up HTML to 4.01 strict
- Added '|' support to the pattern matching routines.
- Pointed out that -t did not sort properly for files with the same
- Suggested option to change HTML title and H1 string.
- Suggested -r option for reversed alphanumeric sort ala 'ls -r'.
- Provided patch to support OS/2, fix HTML encoding, provide charset
support. Added to authors list.
- Debian maintainer who pointed out problems and applied fire to feet to fix
- Suggested -h option for human readable output for -s, ala ls -lh.
- Supplied patch to make tree under cygwin.
- Provided patch to fix a colorization bug when dealing with special
files and directories that seem to have an extension.
- Suggested removing trailing slash on user supplied directory names if -f
option is used.
- Pointed out broken HTML output in 1.5.1.
- Suggested --filelimit option.
- Suggested -v option (version sort).
- Provided build options for Solaris.
- Provided build options and source mods for HP NonStop support.
- Noted that setlocale() should come before MB_CUR_MAX check.
- Submitted patch to remove compiler warnings for Solaris.
- Provided patch which fixes issue where indent may output more than it
should when dirs[*] is not properly cleared before use.
William C. Lathan III
- Showed that tree was not properly quoting arguments to recursively called
tree instances when using -R.
- Submitted patch for --si option.
Tim Waugh (redhat)
- Pointed out a potential memory leak in listdir().
- Tracked down bug where tree would print "argetm" before the filename of a
symbolic link when the "target" option was specified for LINK in dircolors.
- Suggested that tree backslash spaces like ls does for script use. Made
output more like ls.
- Pointed out multiple CLI defenciencies (via Debian)
- Provided patch to make tree more reliably detect the UTF-8 locale.
- Noticed S_ISDOOR/S_IFDOOR spelling mistake for under Solaris.
- Pointed out possible memory overflow in read_dir (path/lbuf not equal in size
- Pointed out problems with the Makefile w/ respect to OSX.
- Provided patch for filesize sorting.
- Pointed out that the HTML output was broken when -L 1 option was used.
- Pointed out that modern systems may use 32 bit uid/gids which could lead
to a potential buffer overflow in the uid/gid to name mapping functions.
- Provided patch to add JSON support.
Brian Mattern & Jason A. Donenfeld
- Provided patch to add --matchdirs functionality.
Jason A. Donenfeld
- Added --caseinsentive, renamed --ignore-case option.
- Bugged me a lot.
- Found a bug where the wrong inode (and device) information would be printed
for symbolic links.
- Fixed issue where mbstowcs() fails to null terminate the string due to
improper UTF-8 encoding leading to garbage being printed.
- Fixed issue with malformed multibyte string handling.
- Pointed out that JSON size output ignored -h/--si flags
John Lane, Tad, others
- Fixed JSON output hanging commas
- Improved command line switch error reporting.
- Symbolic links not displayed if a -P pattern is active
- Missing argument error reporting fixes on long format switches.
- Update BINDIR in Makefile for MacOS X -- It is not allowed to install
programs to /usr/bin on MacOS X any longer due to System Integrity
- Some man page fixes and cleanups
- Suggested adding support for BSD's CLICOLOR and CLICOLOR_FORCE environment
- Make sure we always use xmalloc / xrealloc
- Make XML/HTML/JSON output mutually exclusive.
- Deprecate using local -DLINUX / -DCYGWIN and use the OS provided defines
John A. Fedoruk
- Suggested --filesfirst option.
- Optimized makefile, HP/UX support.
- Suggested --metafirst option
- Honor -n (no color) even if the CLICOLOR_FORCE environment variable is set
Filips Romāns via Debian
- Make tree colorization use reset (rs code in dir_colors,) not normal color
when resetting attributes.
Chentao Credungtao via Debian
- Properly sort --fromfile input
Jake Zimmerman (and others)
- Suggest support for .gitignore files (--gitignore option)
- Always HTML escape filenames in HTML output even when -C is used.
Michiel Beijen (and others)
- Suggest Support multiple -I and -P instances.
- Suggest that / match directories in patterns (also Taylor Faubion)
- Suggested to update MANPATH for OS X
- Various Makefile fixes
- Reported an error with * in the patchmatch code where *foo*bar would match
- Reported HTML url output issue w/ 2.0.0-2.0.1
- Reported Segfault with --filelimit option
- Updates to the Makefile
- Reported use after free error
- Reported same use after error
Saniya Maheshwari / Mig-hub ? / Carlos Pinto
- Reported various issues with --gitignore
- Suggested adding support for --info and --gitignore for the --fromfile
- Add NULL guard for json_printinfo() and xml_printinfo() (and fix ftype
printing for XML)
- Fix getcharset() to not return a getenv() pointer.
- Another attempt at fixing extraneous /'s in HTML URLs/output.
- Fixed XML output
- Suggest adding support for the NO_COLOR environment variable.
- Suggested supporting symbolic links in --fromfile (--fflinks option)
Sith Wijesinghe and Matthew Sessions
- Remove many C90 isms to make compiling with C90 compilers easier.
And many others whom I've failed to keep track of. I should have started
this list years ago.
- Steve Baker