BigItems is a small Bash utility that lists the largest files and directories in a given location. It is useful for quickly discovering what is consuming disk space.
- Bash
- GNU core utilities (
du,find,sort,head,numfmt) - Tested on Linux and macOS
Clone this repository and make the script executable:
git clone <repo-url>
cd bigdata-sins
chmod +x bigitems.sh./bigitems.sh [--files | --dirs | --both] [--top N] [target_directory]--files– show the largest files only--dirs– show the largest directories only--both– show both files and directories (default)--top N– number of results to display (default: 10)target_directory– directory to analyse (defaults to current directory)--help– display help
1. Find the 5 largest files in a directory
./bigitems.sh --files --top 5 /path/to/dir2. Show the largest directories under /var/log
./bigitems.sh --dirs --top 10 /var/log3. Display both files and directories in the current directory
./bigitems.shUse this script periodically to locate and clean up large items before backups or when sharing disk space with others.