1.3 tree
tree – list contents of directories in a tree-like format
1.3.1 Synopsis
tree [-acdfghilnpqrstuvxACDFQNSUX] [-L level [-R]] [-H baseHREF] |
[-T title] [-o filename] [--nolinks] [-P pattern] [-I pattern] |
[--inodes] [--device] [--noreport] [--dirsfirst] [--version] |
[--help] [--filelimit #] [--si] [--prune] [--du] [--timefmt format] |
[--matchdirs] [--fromfile] [--] [directory ...] |
1.3.2 Description
Tree is a recursive directory listing program that produces a depth indented listing of files. With no arguments, tree lists the files in the current directory.
1.3.3 Options
Some of the options:
-l
By default, when a symbolic link is encountered, the path that the symbolic link refers to is printed after the name of the link in the format:name -> real-path
With this option, if the symbolic link refers to an actual directory, then tree will follow the path of the symbolic link as if it were a real directory.-L level
Max display depth of the directory tree.
-a
Print hidden files.
-o filename
Send output to filename.
-p
Print the file type and permissions for each file.
-s
Print the size of each file in bytes.
-h
Print the size of each file in a human readable way.
--du
For each directory report its size as the accumulation of sizes of all its files and sub-directories (and their files, and so on). It implies -s.
-D
Print the date of the last modification time.
--sort[=]type
Sort the output by type instead of name. Possible values are: ctime, mtime, size, version.
--dirsfirst
List directories before files.
-C
Turn colorization on always.
-X
Turn on XML output.
-J
Turn on JSON output.
1.3.4 Examples
tree -aCD --dirsfirst --sort=mtime |
tree -haC --du --dirsfirst --sort=size |
1.3.5 Author
Steve Baker (ice@mama.indstate.edu)
HTML output hacked by Francesc Rocher (rocher@econ.udg.es)
Charsets and OS/2 support by Kyosuke Tokoro (NBG01720@nifty.ne.jp)