Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yaroslaff/mostfiles

List directories and number of files inside to easily find directories with most files.
https://github.com/yaroslaff/mostfiles

count df directories directory du file files filesystem most recursive sort sorted sum top usage

Last synced: 5 days ago
JSON representation

List directories and number of files inside to easily find directories with most files.

Awesome Lists containing this project

README

        

# mostfiles

List directories and number of files inside to easily find directories with most files.

Give it path (default is `.`) and few options
`-d`/`--dir` - each subdirectory counted as 1 file too
`-a`/`--all` - do not ignore hidden files/directories
`-r`/`--recursive` - recursive mode. Mostfiles ALWAYS walks subdirectories recursively, but `-r` flag makes it to count files in nested directories.
`-m`/`--min` - threshold value. Do not print directories which has less then `min` files.

Examples:
~~~shell
$ mostfiles
3 .
1 mostfiles/__pycache__
1 mostfiles
~~~
3 files in current directory, all hidden files/directories (like .gitignore, .git ) are ignored. Only LICENSE, pyproject.toml and README.md are counted. Subdirectory "mostfiles" not counted because `-d` not given.

~~~
$ mostfiles -r
5 .
2 mostfiles
1 mostfiles/__pycache__
~~~
Now `.` has 5 files. 3 in current directory, but also 2 in subdirectories.

~~~
$ mostfiles -ar | head -n 3
32 .
26 .git
13 .git/hooks
~~~
Now, count hidden files/directories (such as .git, .gitignore)