Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Most efficient/fastest way to see disk usage (http://www.linux-archive.org/centos/489566-most-efficient-fastest-way-see-disk-usage.html)

Fajar Priyanto 02-15-2011 08:54 AM

Most efficient/fastest way to see disk usage
 
Hi all,
I use this command to see disk usage:
du -cks * | sort -rn | while read size fname; do for unit in k M G T P
E Z Y; do if [ $size -lt 1024 ]; then echo -e
"${size}${unit} ${fname}"; break; fi; size=$((size/1024)); done; done

The data itself is around 200GB with lots of subdir and small files.
The command takes for about 1 hour to finish.

Is there a faster way to see the disk usage of some directories?

Secondary objective is:
To see which directories have changes (added/remove subdir/files)
comparing to the previous data. I'm thinking of using "ls -laR" and
"diff". But not sure.

Thank you.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Doe 02-15-2011 09:58 AM

Most efficient/fastest way to see disk usage
 
From: Fajar Priyanto <fajarpri@arinet.org>

> To see which directories have changes (added/remove subdir/files)
> comparing to the previous data. I'm thinking of using "ls -laR" and
> "diff". But not sure.

Maybe something like:

find / -exec stat -c "%i %a %u %g %s %Y %Z %n" '{}' ; > before
then rerun after and diff...?

JD



__________________________________________________ __________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 09:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.