Difference between revisions of "Tree (command)"

From wikieduonline
Jump to navigation Jump to search
m (Welcome moved page Tree to Tree (command))
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>tree</code> command list contents of directories in a tree-like format.  
+
{{lc}}
 +
<code>tree</code> command, available since the 90s, [[list]] contents of directories in a tree-like format and including [[JSON]] output support.
 
* [[man]] page: https://linux.die.net/man/1/tree
 
* [[man]] page: https://linux.die.net/man/1/tree
 +
* Homepage: http://mama.indstate.edu/users/ice/tree/
 +
* [[Changelog]]: http://mama.indstate.edu/users/ice/tree/changes.html
  
 
== Installation ==
 
== Installation ==
* <code> [[apt install]] tree</code>
+
* Linux: <code> [[apt install]] tree</code>
 +
* macOS: <code>brew install tree</code>
 +
 
 +
==Commands==
 +
<pre>ubuntu@ubuntu-lts:~$ tree -f -h
 +
.
 +
├── [4.0K]  ./mydirectory1
 +
│   ├── [  0]  ./mydirectory1/file1
 +
│   ├── [  0]  ./mydirectory1/file2
 +
│   ├── [  0]  ./mydirectory1/file3
 +
│   ├── [  0]  ./mydirectory1/file4
 +
│   └── [4.0K]  ./mydirectory1/letters
 +
│      ├── [  13]  ./mydirectory1/letters/books
 +
│      ├── [  0]  ./mydirectory1/letters/magazines
 +
│      └── [  0]  ./mydirectory1/letters/readme
 +
├── [4.0K]  ./mymovies
 +
│   ├── [  0]  ./mymovies/comedy
 +
│   ├── [  0]  ./mymovies/drama
 +
│   ├── [  0]  ./mymovies/terror
 +
│   └── [  0]  ./mymovies/thriller
 +
└── [4.0K]  ./mytrips
 +
    ├── [4.0K]  ./mytrips/mydirexample
 +
    │   └── [  0]  ./mytrips/mydirexample/file.txt
 +
    └── [4.0K]  ./mytrips/pictures
 +
        ├── [  0]  ./mytrips/pictures/Australia
 +
        ├── [  0]  ./mytrips/pictures/France
 +
        ├── [  0]  ./mytrips/pictures/Germany
 +
        ├── [  0]  ./mytrips/pictures/Japan
 +
        └── [  0]  ./mytrips/pictures/USA</pre>
 +
 
 +
 
 +
tree / -L1
 +
 
 +
== Related commands ==
 +
* <code>[[pstree]]</code>
 +
* <code>[[mc tree]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 17:15, 27 November 2022

tree command, available since the 90s, list contents of directories in a tree-like format and including JSON output support.

Installation[edit]

Commands[edit]

ubuntu@ubuntu-lts:~$ tree -f -h
.
├── [4.0K]  ./mydirectory1
│   ├── [   0]  ./mydirectory1/file1
│   ├── [   0]  ./mydirectory1/file2
│   ├── [   0]  ./mydirectory1/file3
│   ├── [   0]  ./mydirectory1/file4
│   └── [4.0K]  ./mydirectory1/letters
│       ├── [  13]  ./mydirectory1/letters/books
│       ├── [   0]  ./mydirectory1/letters/magazines
│       └── [   0]  ./mydirectory1/letters/readme
├── [4.0K]  ./mymovies
│   ├── [   0]  ./mymovies/comedy
│   ├── [   0]  ./mymovies/drama
│   ├── [   0]  ./mymovies/terror
│   └── [   0]  ./mymovies/thriller
└── [4.0K]  ./mytrips
    ├── [4.0K]  ./mytrips/mydirexample
    │   └── [   0]  ./mytrips/mydirexample/file.txt
    └── [4.0K]  ./mytrips/pictures
        ├── [   0]  ./mytrips/pictures/Australia
        ├── [   0]  ./mytrips/pictures/France
        ├── [   0]  ./mytrips/pictures/Germany
        ├── [   0]  ./mytrips/pictures/Japan
        └── [   0]  ./mytrips/pictures/USA


tree / -L1

Related commands[edit]

See also[edit]

Advertising: