LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-05-2014, 03:42 AM   #1
mustoofa
LQ Newbie
 
Registered: Oct 2011
Distribution: CentOS, RHEL, Ubuntu
Posts: 6

Rep: Reputation: Disabled
Is there a 'quick' du command ?


OS : Centos 6.[3|4|5]

Setup : An NFS mounted volume which has a deep directory structure with lots of little files. NFS share lives on a NAS.
by deep, i mean many little directories and sub-directories with lots of little files.

Problem : If I want to find the disk space used by this directory, I run the du -shc command, which takes ages !

Is there a quicker way to do it ? I don't mind if the end result is a bit off by 5 to 10 %
I could run the find command, but that takes ages too. Looking for something which is as quick as df.

This directory sits with other files and directories, or i would have used the df command.

Appreciate your time.

Last edited by mustoofa; 08-05-2014 at 03:46 AM. Reason: corrected wrong versions of centos
 
Old 08-05-2014, 05:16 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
I found du is faster than ls -lR | <script to sum up data> - find will be even slower than ls. Probably a multithreaded version will go faster (so du -shc parallel in all subdirs).
From the other hand you can try to run it from crontab, store the result - and you will always have an approximate result.
 
  


Reply



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
quick question about the who command AmphetaminePhreak Linux - Newbie 7 08-01-2006 05:07 AM
quick command to display all hardware? carl0ski Linux - General 5 07-14-2005 08:30 AM
Simple / quick GUI on the command line ? michael_util Programming 3 01-05-2005 05:08 PM
quick mkinitrd command help imagineaxion Mandriva 2 10-24-2004 02:13 AM
quick restart-X command?? snwright Linux - Software 11 05-12-2004 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:53 PM.

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