2014-04-14 19:56:07 +02:00
|
|
|
# tree
|
|
|
|
|
|
|
|
> Show the contents of the current directory as a tree.
|
|
|
|
|
2016-08-03 12:08:25 +01:00
|
|
|
- Show files and directories up to 'num' levels of depth (where 1 means the current directory):
|
2014-04-14 19:56:07 +02:00
|
|
|
|
|
|
|
`tree -L {{num}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Show directories only:
|
2014-04-14 19:56:07 +02:00
|
|
|
|
|
|
|
`tree -d`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Show hidden files too:
|
2014-04-14 19:56:07 +02:00
|
|
|
|
|
|
|
`tree -a`
|
|
|
|
|
2016-09-16 11:41:23 +01:00
|
|
|
- Print the tree without indentation lines, showing the full path instead (use `-N` to not escape whitespace and special characters):
|
2014-04-14 19:56:07 +02:00
|
|
|
|
2016-08-03 12:05:22 +01:00
|
|
|
`tree -i -f`
|
2015-12-28 23:13:19 -05:00
|
|
|
|
2016-08-24 17:09:58 +01:00
|
|
|
- Print the size of each node next to it, in human-readable format:
|
2015-12-28 23:13:19 -05:00
|
|
|
|
2016-08-24 17:09:58 +01:00
|
|
|
`tree -s -h`
|
2015-12-28 23:13:19 -05:00
|
|
|
|
2016-08-24 17:09:58 +01:00
|
|
|
- Filter the tree using a wildcard (glob) pattern:
|
2015-12-28 23:13:19 -05:00
|
|
|
|
2016-08-24 17:09:58 +01:00
|
|
|
`tree -P {{*.txt}}`
|
2017-12-28 11:04:17 +05:30
|
|
|
|
2017-12-29 08:45:39 +05:30
|
|
|
- Ignore entries that match a wildcard (glob) pattern:
|
2017-12-28 11:04:17 +05:30
|
|
|
|
2017-12-29 08:45:39 +05:30
|
|
|
`tree -I {{*.txt}}`
|