cancel
Showing results for 
Search instead for 
Did you mean: 

difference between df -h and du -sk *

Former Member
0 Kudos

Dear experts:

could you let me know difference between df -h & du -sk * in linux

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

df command Report how much free disk space is available for each mount you have.

You can use this command with different options to get your desired output.

Please check different options as below:

-a, --all include dummy file systems

-B, --block-size=SIZE use SIZE-byte blocks

-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)

-H, --si likewise, but use powers of 1000 not 1024

-i, --inodes list inode information instead of block usage

-k like --block-size=1K

-l, --local limit listing to local file systems

--no-sync do not invoke sync before getting usage info (default)

-P, --portability use the POSIX output format

--sync invoke sync before getting usage info

-t, --type=TYPE limit listing to file systems of type TYPE

-T, --print-type print file system type

-x, --exclude-type=TYPE limit listing to file systems not of type TYPE

--version output version information and exit

df -h will display in Kb, Mb, or Gb.

df -k Will use 1024-byte units, instead of the default 512-byte units, when writing space figures.

http://www.computerhope.com/unix/udf.htm

http://ss64.com/bash/df.html

Reward points if found helpfull..

Best Regards,

Rajat Mandal

Former Member
0 Kudos

when we fire command ls -l

it shows file size. That file size is in Kb OR Mb

Edited by: imaan.shaikh on Feb 12, 2012 12:55 PM

Former Member
0 Kudos

Hi,

ls- l output file size is in KB. But you can get a human readable format by using option h along with l in the command.

Example:

$ ls -l

-rw-r----- 1 ramesh team-dev 9275204 Jun 12 15:27 arch-linux.txt.gz*

$ ls -lh

-rw-r----- 1 ramesh team-dev 8.9M Jun 12 15:27 arch-linux.txt.gz

Best Regards,

Rajat Mandal

Former Member
0 Kudos

Hi,

What is the use of du -s in linux

Former Member
0 Kudos

One of the most important commands in Linux: man (for manual ), e.g.

man du

man df

man ls

For example, man ls will tell you, in contrast to the answer given above, that ls will show the size in bytes.

Hope this helps

Answers (0)