mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Display The Contents Of A Directory As A Tree as a unix til
This commit is contained in:
@@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
||||
|
||||
_859 TILs and counting..._
|
||||
_860 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -762,6 +762,7 @@ _859 TILs and counting..._
|
||||
- [Curling With Basic Auth Credentials](unix/curling-with-basic-auth-credentials.md)
|
||||
- [Display All The Terminal Colors](unix/display-all-the-terminal-colors.md)
|
||||
- [Display Free Disk Space](unix/display-free-disk-space.md)
|
||||
- [Display The Contents Of A Directory As A Tree](unix/display-the-contents-of-a-directory-as-a-tree.md)
|
||||
- [Do Not Overwrite Existing Files](unix/do-not-overwrite-existing-files.md)
|
||||
- [Exclude A Directory With Find](unix/exclude-a-directory-with-find.md)
|
||||
- [Figure Out The Week Of The Year From The Terminal](unix/figure-out-the-week-of-the-year-from-the-terminal.md)
|
||||
|
||||
38
unix/display-the-contents-of-a-directory-as-a-tree.md
Normal file
38
unix/display-the-contents-of-a-directory-as-a-tree.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Display The Contents Of A Directory As A Tree
|
||||
|
||||
The [`exa` utility](https://github.com/ogham/exa) is a speedy replacement for
|
||||
`ls` that offers some additional features. One of those extra features is the
|
||||
_tree_ display.
|
||||
|
||||
By including the `-T` (or `--tree`) flag, `exa` will recurse into a directory
|
||||
and display the entirety of the contents as a tree.
|
||||
|
||||
```bash
|
||||
❯ exa -T
|
||||
.
|
||||
├── folder1
|
||||
│ ├── cats
|
||||
│ │ └── sneaky
|
||||
│ └── dogs
|
||||
│ └── fido
|
||||
└── folder2
|
||||
├── cats
|
||||
│ ├── oreo
|
||||
│ └── sneaky
|
||||
└── dogs
|
||||
└── fido
|
||||
```
|
||||
|
||||
You can target a specific directory:
|
||||
|
||||
```bash
|
||||
❯ exa -T folder2
|
||||
folder2
|
||||
├── cats
|
||||
│ ├── oreo
|
||||
│ └── sneaky
|
||||
└── dogs
|
||||
└── fido
|
||||
```
|
||||
|
||||
See `man exa` for more details.
|
||||
Reference in New Issue
Block a user