Thorium
Thorium

Reputation: 321

BASH 'df' command showing the same numbers for all directories?

I'm trying to get the disk usage of everything within certain directories, which I've been attempting to do with commands like this:

df -h -k /var/www/html/exampledirectory1
df -h -k /var/www/html/exampledirectory2
df -h -k /var/www/html/exampledirectory3

The problem is, that every single directory in the server (even if I just run 'df -h' while within a certain directory) is giving me the exact same numbers, down to the Kilobyte.

Obviously this can't be correct, but I have no idea what it is I'm doing wrong. Can anyone help me out?

(I'm using BASH version 4.2.25 and I'm running Ubuntu 14.10)

Upvotes: 3

Views: 680

Answers (1)

Darwin
Darwin

Reputation: 519

You want to use the du command. df is used for measuring disk usage of a whole partition. Here is an example to determine the disk spaced used by a directory and all sub-directories:

du -sh /home/darwin

Upvotes: 6

Related Questions