10 ms·
> if the directory has many files or sub-directories, tree becomes much less helpful: you only see the last screen full of information as files scroll past you.
by SPBS 5y ago
> if the directory has many files or sub-directories, tree becomes much less helpful: you only see the last screen full of information as files scroll past you.
> broot solves this problem by being aware of the size of your terminal window and adapting its output to fit it.
What? You can just pipe `tree` into `less`. The solution isn't to download Yet Another Binary that does this specific thing and doesn't come installed on most platforms.
- deepfriedrice 5y agoWhat's wrong with solving problems the unix guys already solved decades ago, and doing so less elegantly?
- thefz 5y agoExactly, this is the opposite of the unix way of doing things. Do only one thing and well, be nimble.
- capableweb 5y ago> this is the opposite of the unix way of doing things Which makes sense, this is an article for people on Apple hardware (judging by the installation instructions), so no interest in keeping things "the unix way of doing things"
- BoxOfRain 5y agoI have no dog in this fight (I use both Linux and macOS as daily drivers) but it could be argued that macOS has more of a claim to be Unix than Linux since the foundation of macOS comes from NeXTSTEP and FreeBSD whose codebases both ultimately descend from the original Bell Labs Unix, whereas Linux started life completely independently. I'd argue that Linux is more Unixy than macOS in terms of philosophy though, I remember reading that Dennis Ritchie considered Linux as much of a Unix as the other offerings on the market at the time which were the BSDs and commercial Unix variants; his opinion is obviously worth thousands of mine!
- dec0dedab0de 5y agoOSx is also Unix certified by the open group, along with hp-ux and aix. https://www.opengroup.org/openbrand/register/ https://www.opengroup.org/openbrand/register/
- joshuaissac 5y agoThere is a Linux distro in that list, too: Huawei's EulerOS, based on CentOS.
- indianboy42 5y agoUse broot as tree is not necessary of course `tree | less` works for that but as hinted in the article broot contains a lot more features. Fuzzy finding, preview, multiwindow copy/paste, renaming, directory navigation etc
- wruza 5y agoDoes it contain emacs? That would be nice.
- awestroke 5y agoWhat would be nice about that?
- kitd 5y agoThere's a broot alternative called lf that opens files in $EDITOR https://github.com/gokcehan/lf https://github.com/gokcehan/lf
- jcynix 5y agoWhat's wrong with dired mode? Ok, you'll get each directory in its own buffer. But, thinking of that, it shouldn't be to hard to make dired mode recurse into subdirectories inside the same buffer. (And fold/unfold like orgmode does. ;-)
- natrys 5y ago
- arp242 5y agoI generally just use zsh globbing for this by the way: ls **(.) To list all files, recursively, or some variation thereof depending what I want: *(/) for directories, *() for executable files, etc. With a global alias it can be piped to less with LL: "ls *(.) LL". You can actually do a lot of stuff with it, and is basically good replacement for find, except with less typing. The syntax looks a bit daunting at first, but especially for basic stuff it's not that hard (e.g. / and is the same as what ls -F uses). I wish there was a better pager than less though, but haven't really found it (and no, Rust project X with 115 different colours that don't even work on a light background and/or "fuzzy" matching that never gives me what I want is not it).
- lamontcg 5y agoWell if we wanna be grumpy this morning... I don't understand why people don't learn how to use `find` properly. And just doing simple things correctly like the `-print0` integration with `xargs -0` to be able to safely send a list of files into rm even if they've got spaces or whatever. I never have much use for `tree` unless I'm trying to take a screenshot and make it look kind of nice.
- lobocinza 5y agofind and grep are mandatory tools of the Linux toolbox but I use fd and ripgrep most of the time.
- dystroy 5y ago[broot author here] Have you ever tried to pipe `tree` into `less` in a real code directory, with directories containing thousands of files ? That solves no problem. The idea of broot isn't just to "be aware of the size of your terminal": its view is BFS based to show you a useful overview. See explanation here: https://dystroy.org/broot/#get-an-overview-of-a-directory-even-a-big-one https://dystroy.org/broot/#get-an-overview-of-a-directory-ev...