×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

du -ks * is very slow

du -ks * is very slow

du -ks * is very slow

(OP)
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
 

RE: du -ks * is very slow

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.

RE: du -ks * is very slow

(OP)
Many thanks Annihilannic.
 

RE: du -ks * is very slow

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.

RE: du -ks * is very slow

(OP)
Thank you Annihilannic - let me try it...

Regards,
Dan

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close