Table of Contents
- Disk Usage / File Analysis
- AWS S3 commands
Disk Usage / File Analysis
Find out space taken by files older than 5 days
find . -type f -mtime +5 -print0 | du --files0-from=- -ch | grep totalKeep last 100d fies
ls -t | sed -e '1,100d' | xargs -d '\n' rm -f --truncate -s 50M catalina.outls -d */AWS S3 commands
Download files of a particulat date (files having date format in name):
Here’s the AWS CLI command to download only the March 23 files:
aws s3 cp s3://<your-bucket-name>/ . --recursive --exclude "*" --include "*.2026-03-23.*"This uses --exclude “” to block everything, then --include “.2026-03-23.*” to selectively grab the three 2026-03-23 files.
s3 remove all files from a dir (prefix)
To remove all files from a directory (prefix) in S3:
aws s3 rm s3://your-bucket-name/your-prefix/ --recursiveThe --recursive flag deletes everything under that prefix.
Dry run – see what would be deleted without actually deleting:
aws s3 rm s3://your-bucket-name/your-prefix/ --recursive --dryrun