Notes on using free commands in Linux

Source: Internet
Author: User

The free command is used to display the current system's memory idle and usage, including physical memory, swap partition memory, kernel buffer memory and high-speed cache. The free parameter reports an error:

-B -- Display memory usage in bytes

[Root @ redhat ~] # Free-B
Total used free shared buffers cached
Mem: 521449472 138665984 382783488 0 14675968 60305408
-/+ Buffers/cache: 63684608 457764864
Swap: 2147475456 0 2147475456

-K -- kb Display memory usage

[Root @ redhat ~] # Free-k
Total used free shared buffers cached
Mem: 509228 135416 373812 0 14320 58892
-/+ Buffers/cache: 62204 447024
Swap: 2097144 0 2097144

-M -- displays the memory usage of the current system in MB mode.

[Root @ redhat ~] # Free-m
Total used free shared buffers cached
Mem: 497 132 365 0 13 57
-/+ Buffers/cache: 60 436
Swap: 2047 0 2047

-G -- Display memory usage in GB Mode

[Root @ redhat ~] # Free-g
Total used free shared buffers cached
Mem: 0 0 0 0 0 0
-/+ Buffers/cache: 0 0
Swap: 1 0 1

 

-O -- display in the old format. The so-called old format is not to display the "-/+ buffers/cache" line.

[Root @ redhat ~] # Free-o
Total used free shared buffers cached
Mem: 509228 135532 373696 0 14340 58892
Swap: 2097144 0 2097144

-S -- specifies the time to refresh, measured in seconds.

[Root @ redhat ~] # Free-s 3 // refresh every three seconds

Total used free shared buffers cached Mem: 509228 135772 373456 14380 0 58924-/+ buffers/cache: 62468 446760 2097144 Swap: 2097144 0

Total used free shared buffers cached Mem: 509228 135788 373440 14380 0 58924-/+ buffers/cache: 62484 446744 2097144 Swap: 2097144 0

-C -- specify the number of refreshes. It must be used in combination with the-s parameter.

[Root @ redhat ~] # Free-s1-c2 // refresh once per second, refresh twice in total

Total used free shared buffers cached Mem: 509228 135772 373456 14404 0 58924-/+ buffers/cache: 62444 446784 2097144 Swap: 2097144 0

Total used free shared buffers cached Mem: 509228 135788 373440 14404 0 58924-/+ buffers/cache: 62460 446768 2097144 Swap: 2097144 0

-V -- display the free command version of the current system

[Root @ redhat ~] # Free-V
Procps version 3.2.8

 

The more common ones are free-m or-g, and the rest will be fine.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.