Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

du -ks * is very slow

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
0
0
US
Good Day,

On a couple of servers, the following command - 'du -ks *' can run for an hour or two - really not pleasant. What might be the reason for that?

Is there, by any chance, any other way, which can point to the large directories on the server?

Regards,
Dan
 
Unfortunately, if there are thousands or millions of files on the filesystem, there is no shortcut that I'm aware of.

Perhaps you need to consider breaking the filesystem down into several smaller ones to make them more manageable, then you can see immediately how much is used on the individual ones using df.

Annihilannic.
 
Out of curiosity... is an ls -lR > /tmp/sometempfile any quicker? If so, you could write a script to parse the output and get a quicker result. It wouldn't be as accurate because it wouldn't report the "true" space usage of each file (i.e. it would under-report the unoccupied space in the last blocks of each file, or space used by "sparse" files) but may still be useful for you.

Annihilannic.
 
Thank you Annihilannic - let me try it...

Regards,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top