help with du


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help with du
# 1  
Old 01-12-2011
help with du

Im using du -hs command to get the disk space utilization at my home directory and found that it to be taking long time to return the disk space(1.5TB). Is there any other way to retrieve the disk space quicker..?
# 2  
Old 01-12-2011
What Operating System and version are you running?
# 3  
Old 01-12-2011
It is GNU/Linux operating system and version is: #1 SMP 2008 and with ZSH as default shell.

Last edited by michaelrozar17; 01-13-2011 at 09:31 AM.. Reason: added the shell type
# 4  
Old 01-12-2011
I don't have that but "df" should do it:
Code:
df -k /home

# 5  
Old 01-13-2011
so can we use df -k /home/dir instead of du -hs (run in home dir).I found both to give almost the same result, just to confirm can you say me the value under Used column for df -k command is in bytes or kilo bytes? If its KB then both the commands give the same output.
# 6  
Old 01-13-2011
Yes the output from "df -k" is in kilobytes.

You will often get small differences between the figures for "du" and "df" due to sparse files and open files. Apart from being quicker, "df" is more accurate.


Most modern unix/Linux systems produce comparable output format with the command "df -Pk". See "man df" on your system.
This User Gave Thanks to methyl For This Post:
# 7  
Old 01-13-2011
Thank for your information.This command saves much time.Just struck my mind option, -k is used to display size in Kb(silly question Smilie)
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question