(linenum→info "unix/slp.c:2238")

tree/1.5.1.1/man/tree.1

    1: .\" $Copyright: $
    2: .\" Copyright (c) 1996 - 2007 by Steve Baker
    3: .\" All Rights reserved
    4: .\"
    5: .\" This program is free software; you can redistribute it and/or modify
    6: .\" it under the terms of the GNU General Public License as published by
    7: .\" the Free Software Foundation; either version 2 of the License, or
    8: .\" (at your option) any later version.
    9: .\"
   10: .\" This program is distributed in the hope that it will be useful,
   11: .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
   12: .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13: .\" GNU General Public License for more details.
   14: .\"
   15: .\" You should have received a copy of the GNU General Public License
   16: .\" along with this program; if not, write to the Free Software
   17: .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   18: .\"
   19: ...
   20: .TH TREE 1 "\*(V)" "Tree 1.5.1.1"
   21: .SH NAME
   22: tree \- list contents of directories in a tree-like format.
   23: .SH SYNOPSIS
   24: \fBtree\fP [\fB-adfghilnopqrstuxACDFNS\fP] [\fB-L\fP \fIlevel\fP [\fB-R\fP]] [\fB-H\fP \fIbaseHREF\fP] [\fB-T\fP \fItitle\fP] [\fB-o\fP \fIfilename\fP] [\fB--nolinks\fP] [\fB-P\fP \fIpattern\fP] [\fB-I\fP \fIpattern\fP] [\fB--inodes\fP] [\fB--device\fP] [\fB--noreport\fP] [\fB--dirsfirst\fP] [\fB--version\fP] [\fB--help\fP] [\fIdirectory\fP ...]
   25: .br
   26: .SH DESCRIPTION
   27: \fITree\fP is a recursive directory listing program that produces a depth
   28: indented listing of files, which is colorized ala \fIdircolors\fP if the \fBLS_COLORS\fP
   29: environment variable is set and output is to tty.  With no arguments,
   30: \fItree\fP lists the files in the current directory.  When directory
   31: arguments are given, \fItree\fP lists all the files and/or directories found
   32: in the given directories each in turn.  Upon completion of listing all
   33: files/directories found, \fItree\fP returns the total number of files and/or
   34: directories listed.
   35: 
   36: By default, when a symbolic link is encountered, the path that the symbolic
   37: link refers to is printed after the name of the link in the format:
   38: .br
   39: 
   40:     name -> real-path
   41: .br
   42: 
   43: If the `\fB-l\fP' option is given and the symbolic link refers to an actual
   44: directory, then \fItree\fP will follow the path of the symbolic link as if
   45: it were a real directory.
   46: .br
   47: 
   48: .SH OPTIONS
   49: \fITree\fP understands the following command line switches:
   50: 
   51: .TP
   52: .B --help
   53: Outputs a verbose usage listing.
   54: .PP
   55: .TP
   56: .B --version
   57: Outputs the version of tree.
   58: .PP
   59: .TP
   60: .B -a
   61: All files are printed.  By default tree does not print hidden files (those
   62: beginning with a dot `.').  In no event does tree print the file system
   63: constructs `.' (current directory) and `..' (previous directory).
   64: .PP
   65: .TP
   66: .B -d
   67: List directories only.
   68: .PP
   69: .TP
   70: .B -f
   71: Prints the full path prefix for each file.
   72: .PP
   73: .TP
   74: .B -i
   75: Makes tree not print the indentation lines, useful when used in conjunction
   76: with the \fB-f\fP option.
   77: .PP
   78: .TP
   79: .B -l
   80: Follows symbolic links if they point to directories, as if they were
   81: directories. Symbolic links that will result in recursion are avoided when
   82: detected.
   83: .PP
   84: .TP
   85: .B -x
   86: Stay on the current file-system only.  Ala \fBfind \fI-xdev\fP.
   87: .PP
   88: .TP
   89: .B -P \fIpattern\fP
   90: List only those files that match the wild-card \fIpattern\fP.  Note: you must use
   91: the \fI-a\fP option to also consider those files beginning with a dot `.' for
   92: matching.  Valid wildcard operators are `*' (any zero or more characters), `?' (any
   93: single character), `[...]' (any single character listed between brackets (optional -
   94: (dash) for character range may be used: ex: [A-Z]), and `[^...]' (any single character
   95: not listed in brackets) and `|' separates alternate patterns.
   96: .PP
   97: .TP
   98: .B -I \fIpattern\fP
   99: Do not list those files that match the wild-card \fIpattern\fP.
  100: .PP
  101: .TP
  102: .B --noreport
  103: Omits printing of the file and directory report at the end of the tree
  104: listing.
  105: .PP
  106: .TP
  107: .B -p
  108: Print the file type and permissions for each file (as per ls -l).
  109: .PP
  110: .TP
  111: .B -s
  112: Print the size of each file in bytes along with the name.
  113: .PP
  114: .TP
  115: .B -h
  116: Print the size of each file but in a more human readable way, e.g. appending a
  117: size letter for kilobytes (K), megabytes (M), gigabytes (G), terrabytes (T),
  118: petabytes (P) and exabytes (E).
  119: .PP
  120: .TP
  121: .B -u
  122: Print the username, or UID # if no username is available, of the file.
  123: .PP
  124: .TP
  125: .B -g
  126: Print the group name, or GID # if no group name is available, of the file.
  127: .PP
  128: .TP
  129: .B -D
  130: Print the date of the last modification time for the file listed.
  131: .PP
  132: .TP
  133: .B --inodes
  134: Prints the inode number of the file or directory
  135: .PP
  136: .TP
  137: .B --device
  138: Prints the device number to which the file or directory belongs
  139: .PP
  140: .TP
  141: .B -F
  142: Append a `/' for directories, a `=' for socket files, a `*' for executable files
  143: and a `|' for FIFO's, as per ls -F
  144: .PP
  145: .TP
  146: .B -q
  147: Print non-printable characters in filenames as question marks instead of the default
  148: caret notation.
  149: .PP
  150: .TP
  151: .B -N
  152: Print non-printable characters as is instead of the default carrot notation.
  153: .PP
  154: .TP
  155: .B -r
  156: Sort the output in reverse alphabetic order.
  157: .PP
  158: .TP
  159: .B -t
  160: Sort the output by last modification time instead of alphabetically.
  161: .PP
  162: .TP
  163: .B --dirsfirst
  164: List directories before files.
  165: .PP
  166: .TP
  167: .B -n
  168: Turn colorization off always, over-ridden by the \fB-C\fP option.
  169: .PP
  170: .TP
  171: .B -C
  172: Turn colorization on always, using built-in color defaults if the LS_COLORS
  173: environment variable is not set.  Useful to colorize output to a pipe.
  174: .PP
  175: .TP
  176: .B -A
  177: Turn on ANSI line graphics hack when printing the indentation lines.
  178: .PP
  179: .TP
  180: .B -S
  181: Turn on ASCII line graphics (useful when using linux console mode fonts). This
  182: option is now equivalent to `--charset=IBM437' and will eventually be
  183: depreciated.
  184: .PP
  185: .TP
  186: .B -L \fIlevel\fP
  187: Max display depth of the directory tree.
  188: .PP
  189: .TP
  190: .B -R
  191: Recursively cross down the tree each \fIlevel\fP directories (see \fB-L\fP
  192: option), and at each of them execute \fBtree\fP again adding `-o 00Tree.html'
  193: as a new option.
  194: .PP
  195: .TP
  196: .B -H \fIbaseHREF\fP
  197: Turn on HTML output, including HTTP references. Useful for ftp sites.
  198: \fIbaseHREF\fP gives the base ftp location when using HTML output. That is, the local
  199: directory may be `/local/ftp/pub', but it must be referenced as
  200: `ftp://hostname.organization.domain/pub' (\fIbaseHREF\fP should be
  201: `ftp://hostname.organization.domain'). Hint: don't use ANSI lines with this option,
  202: and don't give more than one directory in the directory list. If you wish to
  203: use colors via CCS stylesheet, use the -C option in addition to this option
  204: to force color output.
  205: .PP
  206: .TP
  207: .B -T \fItitle\fP
  208: Sets the title and H1 header string in HTML output mode.
  209: .PP
  210: .TP
  211: .B --charset \fIcharset\fP
  212: Set the character set to use when outputting HTML and for line drawing.
  213: .PP
  214: .TP
  215: .B --nolinks
  216: Turns off hyperlinks in HTML output.
  217: .PP
  218: .TP
  219: .B -o \fIfilename\fP
  220: Send output to \fIfilename\fP.
  221: .PP
  222: .br
  223: .SH FILES
  224: /etc/DIR_COLORS         System color database.
  225: .br
  226: ~/.dircolors                    Users color database.
  227: .br
  228: 
  229: .SH ENVIRONMENT
  230: \fBLS_COLORS\fP         Color information created by dircolors
  231: .br
  232: \fBTREE_CHARSET\fP      Character set for tree to use in HTML mode.
  233: .br
  234: \fBLC_CTYPE\fP          Locale for filename output.
  235: 
  236: .SH AUTHOR
  237: Steve Baker (ice@mama.indstate.edu)
  238: .br
  239: HTML output hacked by Francesc Rocher (rocher@econ.udg.es)
  240: .br
  241: Charsets and OS/2 support by Kyosuke Tokoro (NBG01720@nifty.ne.jp)
  242: 
  243: .SH BUGS
  244: Tree does not prune "empty" directories when the -P and -I options are used.
  245: Tree prints directories as it comes to them, so cannot accumulate information
  246: on files and directories beneath the directory it is printing.
  247: 
  248: The -h option rounds to the nearest whole number unlike the ls implementation
  249: of -h which rounds up always.  The IEC standard names for powers of 2
  250: cooresponding to metric powers of 10 (KiBi, et al.) are gay.
  251: 
  252: Probably more.
  253: 
  254: .SH SEE ALSO
  255: .BR dircolors (1L),
  256: .BR ls (1L),
  257: .BR find (1L)
Syntax (Markdown)