Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Aug 22 '13 at 11:31

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

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
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


share|improve this answer

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. – Reddi Rajendra P 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

You must log in to answer this question.