top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the use and difference of df and free command in linux?

+4 votes
5,701 views

As per my understanding, both command will show total memory available in the system, (correct me if i am wrong), then what is the difference between them?

posted Feb 2, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

df: displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown.

Example

$ df

Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/loop0      18761008  15246876   2554440  86% /
none                   4         0         4   0% /sys/fs/cgroup
udev              493812         4    493808   1% /dev
tmpfs             100672      1364     99308   2% /run
none                5120         0      5120   0% /run/lock
none              503352      1764    501588   1% /run/shm
none              102400        20    102380   1% /run/user
/dev/sda3      174766076 164417964  10348112  95% /host

Free: Display RAM details in Linux machine

Example

$ free
total used free shared buffers cached
Mem: 8027952 4377300 3650652 0 103648 1630364
-/+ buffers/cache: 2643288 5384664
Swap: 15624188 608948 15015240

Where

Line 1: Indicates Memory details like total available RAM, used RAM, Shared RAM, RAM used for buffers, RAM used of caching content.
Line 2: Indicates total buffers/Cache used and free.
Line 3: Indicates total swap memory available, used swap and free swap memory size available.

So in short df is for disk and free is for RAM.

PS: User give more attention to the question which is coming from some name, anonymous question get less attention so please register and ask.

answer Feb 2, 2015 by Salil Agrawal
Thank you Sir...
Similar Questions
0 votes

I want to know when "apt-add-repository" becomes mandatory to run in Ubuntu machine. Usually I used following two commands many times.
$sudo apt-get update
$sudo apt-get install

+3 votes
+2 votes

I have a huge code base and it is showing files with zero bytes .
Can someone share a linux command to delete files with zero bytes in one attempt ?

...