Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/yaroslaff/mostfiles
- Owner: yaroslaff
- License: mit
- Created: 2024-07-03T12:55:52.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-08-06T09:07:10.000Z (3 months ago)
- Last Synced: 2024-10-06T12:37:32.084Z (about 1 month ago)
- Topics: count, df, directories, directory, du, file, files, filesystem, most, recursive, sort, sorted, sum, top, usage
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)