Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of files printed per directory in tree mode? #1103

Open
sainttttt opened this issue Aug 28, 2024 · 5 comments
Open

Limit number of files printed per directory in tree mode? #1103

sainttttt opened this issue Aug 28, 2024 · 5 comments
Labels
question Further information is requested

Comments

@sainttttt
Copy link

Hi! I was wondering if there's a way to limit the number of files printed out per directory in tree mode. There can be a case where one directory has a ton of files and most others don't and it messes up the whole output. Is this configurable at all? Are there any other utilities that do this perhaps?

Thanks!

@sainttttt sainttttt added the question Further information is requested label Aug 28, 2024
@cafkafk
Copy link
Member

cafkafk commented Aug 28, 2024

Could be a useful feature, I don't know that we have something that do this.

I thought in general that would limit output to e.g. terminal width or some fix amount like

eza --limit-output 50
file
file
file 
[523 files skipped...]
file
file
file

Would be useful, if that also supported directories in tree output maybe that would be a really nice solution?

@MartinFillon
Copy link
Contributor

If we implement this, should we keep the first n lines and last n lines ? Should we implement this on any options ?

@jack-mil
Copy link

would be a very cool feature, would make me less nervous about viewing large or unknown directories with --tree.
Great for getting aquick understanding of the directory structure without flooding the terminal with long lists of files. 2-3 files per level would make sense. It could even scale so with a small number of files, all are show, but if the directory contains many, then elide/collapse into ... or something

@sainttttt
Copy link
Author

@MartinFillon I think having an option for either first n lines only or first n and last n would be good. If I had to pick only one though I would go for first n and last n though, I think that gives it a better overview. It is what libraries like pandas does when printing a large dataframe.

@MartinFillon
Copy link
Contributor

Well as per the current codebase design, implementing it for tree without computing all the lines will kinda be complex and need some thoughts to be put into it, for the other ways such as long I think it is indeed doable and a good idea, I am going to look into this when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants