A pragmatic way to view your file sizes. Think of it as an easier-to-use and more intuitive alternative to the du coreutil.
This project is still under development and might contain bugs and crappy code! Please open issues/PRs if you find something janky.
Let's take a look at how we can use this utility in a directory.
bash
sz .
this will be the output:
```bash
file/dir name | size
---------------+---------
sz | 41.52KB
10 files parsed ```
bash
sz . -l
-g
and -i
flag respectively.bash
sz . -l -i -g
-n
argument or include the
-L
flag to list all the items.bash
sz . -l -i -g -n 30 # show me the first 30 items
bash
sz . -l -i -g -L # show me all the files
-d
and -a
flags.bash
sz . -l -d -n 5 # returns the 5 largest files in the current directory
bash
sz . -l -a -n 6 # returns the 6 smallest files in the current directory
-D
flag.
this flag will only show directories with the parent same as the path provided.
it will not list any files.bash
sz ~/Documents/rl -l -D
-R
flag.bash
sz ~/Documents/rl -l -D -R
note that you can use all the options previously mentioned with the -D
flag too.
```bash
sz ~/Documents/rl -l -D -R -i -g -d -n 3 ```
-e
flag to exclude directoriesbash
sz ~/Documents/rl -l -D -R -d -e ~/Documents/rl/public/ ~/Documents/rl/assets/
warning: this arg doesn't really work with the -i
or -g
-s
flag to show the total line count of all the files parsed. Run this only with
UTF-8 encoded files, obviously.bash
sz ./src -l -s
The options are pretty simple yet powerful:
bash
Options:
-d, --sort-files-desc Sort items by size in descending order
-a, --sort-files-asc Sort items by size in ascending order
-i, --include-hidden Include hidden files
-l, --list-files List the files in the directory
-L, --list-all List all files in the directory even if directory count exceeds 50
-g, --include-gitignored Include gitignored files
-e, --exclude-dirs <EXCLUDE_DIRS>... Directories to exclude
-n, --num-files <NUM_FILES> Number of files to list
-D, --only-dirs Show only directories
-R, --recursive-dirs Recursively list directories (Only to be used with -D flag)
-s, --show-lines Show total line count for items
-h, --help Print help
Run sz -h
to view this help message.