free
is provided by procps-ng
; Debian 8 has version 3.3.9, which uses the old style with a separate line for buffers/cache
, while Gentoo and presumably RHEL 7.x have version 3.3.10 or later which uses the new style. You can see the reasoning behind the change in the corresponding commit message.
If you really want the old-style output you can run an older version of procps
, but you'll find that distributions will migrate to the newer style by default. The newer style also gives the amount of available memory which is a really useful piece of information (see How can I get the amount of available memory portably across distributions? for details).
Somewhat confusingly, version 3.3.9 refers to the format without the buffers/cache
line as "old format", and you can see it in that version with free -o
. So all told:
versions 3.3.9 and earlier show by default
total used free shared buffers cached
Mem: 31G 30G 539M 1.1G 2.2G 15G
-/+ buffers/cache: 13G 18G
Swap: 31G 180M 31G
versions 3.3.9 and earlier, with -o
, show
total used free shared buffers cached
Mem: 31G 30G 549M 1.1G 2.2G 15G
Swap: 31G 180M 31G
versions 3.3.10 and later only show
total used free shared buff/cache available
Mem: 31G 7.8G 525M 1.1G 23G 22G
Swap: 31G 180M 31G
versions 3.3.10 and later also have a wide output mode, -w
, which shows
total used free shared buffers cache available
Mem: 31G 7.8G 531M 1.1G 2.2G 20G 22G
Swap: 31G 180M 31G
(This is all on the same system; note how the accounting is more accurate with the later versions.)
free
comes inprocps
notcoreutils
(at least on redhat/centos/fedora); from your output, it seems debian runs by default asfree -o
(disables the display of a "buffer adjusted" line), check if you have any aliases defined. – guido Apr 07 '16 at 13:41-/+ buffers/cache
line which was removed in 3.3.10. Running 3.3.9 on a new kernel will produce the old-style output. – Stephen Kitt Apr 07 '16 at 13:42buffers/cache
line was because the addition of the "available" field renders it useless. OK, I'll reopen it then. – terdon Apr 07 '16 at 13:44-o
option, look at the "available" field. I have the same output on Arch and no-o
option available. – terdon Apr 07 '16 at 13:44