Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-30-2010, 11:56 AM   #1
Registered: Jan 2007
Location: Dallas, Oregon
Distribution: Ubuntu; Knoppix; DSL; Raspbian
Posts: 30

Rep: Reputation: 0
disk usage by file age

I'm trying to figure out how to gather some disk data. What I need is
to find the disk usage by subfolder, but only by files older than a
certain time. I can get a list of files with
find ./ftp/news +mtime 180
and get a list of everything older than six months.
I can do
du -sh ./ftp/news/*
and find the usage by subfolder.
What I need is to combine the two, so I get something like

15M ftp/news/4-Dallas
40M ftp/news/4-Washington
560M ftp/news/House
1.1G ftp/news/Senate
717M ftp/news/White House
69M ftp/news/YIR 2009
65M ftp/news/stuff

knowing that the size is for files over six months old.

Any simple ideas for this?

Old 06-30-2010, 02:29 PM   #2
Senior Member
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
Does this give you what you want?

find ./ftp/news +mtime 180 -exec du -sh {} \;
Not sure if I'm understanding you well enough to give a proper answer.




ctime, disk, du, mtime, usage

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a 28gb log file has no impact on disk usage, can someone explain why? Andrew.Johnstone Linux - General 3 10-21-2008 05:50 AM
Removed a large file but disk usage not updated. LucL Red Hat 2 03-21-2007 07:46 PM
file age checking Oinopion Slackware 8 03-11-2006 06:37 AM
Can't get Age of Empires II: Age of Kings started (I've could it before !!!) vegetassj2 Linux - Games 44 08-28-2005 04:59 PM
Disk space by age? mem16421 Linux - Software 15 04-09-2005 01:16 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration