Home > Uncategorized > Napkin notes

Napkin notes

Find disk capacity used by files older than a given date:

find . -type f -atime +30 -print0 2>/dev/null| du -hc --files0-from - | \
tail -n 1

And wrap it in a loop to show capacity by various dates:

for a in 30 90 180 365 730 1460 11680; do \
echo -n "Files older than $a days = "; \
find . -type f -atime +$a -print0 2>/dev/null| \
du -hc --files0-from - | tail -n 1; done

 

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: