Re: [gentoo-user] Listing directories with size greater than...
On Friday 22 July 2005 09:17 am, Ryan Viljoen wrote: I need some help with listing home directories that are greater than i given size. I have tried find /home -type d -size +5k and find /home -type d -size +5k -iname * Both without much success... Any help will be :D Cheers Rav Try this: find /home/ -size +5 -exec ls -lahg {} \; -- Chris Linux 2.6.12-gentoo-r6 i686 AMD Athlon(tm) XP 00:56:23 up 15:58, 6 users, load average: 0.44, 0.17, 0.09 -- gentoo-user@gentoo.org mailing list
RE: [gentoo-user] Listing directories with size greater than...
I need some help with listing home directories that are greater than i given size. I have tried find /home -type d -size +5k and find /home -type d -size +5k -iname * Both without much success... find will not calculate folder sizes (as you've already seen). You'll need to use du and then filter the output. Perchance something like: du | grep -v \/ | sort -n This should give you the directories (in the current dir) w/o the sub directories but include the calculated size of the directory sorted numerically on the output. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] Listing directories with size greater than...
Dave Nebinger wrote: I need some help with listing home directories that are greater than i given size. I have tried find /home -type d -size +5k and find /home -type d -size +5k -iname * Both without much success... find will not calculate folder sizes (as you've already seen). You'll need to use du and then filter the output. Perchance something like: du | grep -v \/ | sort -n This should give you the directories (in the current dir) w/o the sub directories but include the calculated size of the directory sorted numerically on the output. You can do something similar with a pair of recursive du: du -S ./ | grep -E ^[5-9][0-9]{4}[^0-9] du -S ./ | grep -E ^[0-9]{6,} The first command will give you a listing of all directories with 5-9k of files. The second gives you all directories with 10k+ of files. Neither size includes subdirectories, so if you want sub-directories included in the math, just take out the '-S' option. -Richard -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] Listing directories with size greater than...
On 22 July 2005 15:17, Ryan Viljoen wrote: I need some help with listing home directories that are greater than i given size. I have tried find /home -type d -size +5k and find /home -type d -size +5k -iname * Both without much success... du -k --max-depth=1 /home | sort -nrk1 Alright, this doesn't give you home directory with more than 5Kb of size only but all. Still, they are sorted by size. Uwe -- 95% of all programmers rate themselves among the top 5% of all software developers. - Linus Torvalds http://www.uwix.iway.na (last updated: 20.06.2004) -- gentoo-user@gentoo.org mailing list