tree
FilesBeginner In simulator In real LinuxList a directory as a tree
Name: tree: shows directories as a tree
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
tree lists a directory recursively, drawing the hierarchy with indented lines and counting directories and files at the end. It is a quick way to get a feel for a project's layout.
Most distributions don't install it by default; get it from the package manager (e.g. apt install tree).
Syntax
tree [OPTION]... [DIR]Common options
| -a | Include hidden files |
| -d | List directories only |
| -L LEVEL | Limit the depth, e.g. -L 2 |
| -f | Print the full path of each entry |
| -h | Show sizes with K, M and so on |
| -p | Show permissions |
| -D | Show modification times |
| -I PATTERN | Leave out names matching PATTERN, e.g. -I node_modules |
| -P PATTERN | Show only files matching PATTERN, e.g. -P "*.py" |
| --dirsfirst | List directories before files |
| --noreport | Leave out the closing count of directories and files |