Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to search all file system in linux .I need a find disk space utilization of the entire filesystem based on search result ?

share|improve this question

migrated from stackoverflow.com Aug 22 '13 at 11:31

This question came from our site for professional and enthusiast programmers.

2  
Try bash command: df -h –  broadband Aug 22 '13 at 6:37
    
@broadband df is a utility program, not a bash command. –  Jens Aug 22 '13 at 6:46
    
@Jens you are right. Thank you. –  broadband Aug 22 '13 at 6:47

8 Answers 8

df .

is all you need, in any directory you care to be. Or with the path

df /path/of/the/interesting/directory

In other news, has the apropos command stopped working?

$ apropos "file system"
[...]
df                   (1)  - report file system disk space usage
share|improve this answer

"df -hl" command could help you on this.

share|improve this answer

A portable way is:

df -k /ask

and most systems support the more readable

df -h /ask
share|improve this answer
df       # file system usage info
df -h    # same, but in human readable format
df -a    # all system and dummy file system usage info    

Look at man df for more useful info.

share|improve this answer
find any-path | xargs du -sh

for example

find /home/user/movies | xargs du -sh
share|improve this answer

I think your'e best shot is using df and using a unix pipe to extract the data you need. You ould possibly use awk or grep for this.

share|improve this answer

There are a lot of things you can do, but I like the following:

Find currently growing files

    cd / ; touch now ; find . -newer /now -type f -print0 | du --files0-from=- | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf ("%6.1f\t%s\t%25s  %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),$2);}' | tail -n10

Find largest files

    cd / ; find . -type f -print0 | du --files0-from=- | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf ("%6.1f\t%s\t%25s  %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),$2);}' | tail -n10

Enjoy

share|improve this answer
free

command will be very handy. Because as you want to know the disk free, you can remember it very well.
You have additional options to view the output as you want.

free -b     -> display usage in bytes.
free -k     -> display usage in KB.
free -m     -> display usage in MB.
free -g     -> display usage in GB.

Also the total RAM+Swap memory, etc.. have a look free --help and play with it.

share|improve this answer
    
free displays memory, not diskspace use, so is not what the OP wants. –  Jens Aug 22 '13 at 12:48
    
hello.. -jens. just go through the output of free command. it displays.. total, used and free memory. –  Rajendra Sep 20 '13 at 8:21
    
no free doesn't display free file system space (it displays free RAM). Please read and understand the actual question. Disk space is not RAM. –  Jens Sep 20 '13 at 9:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.