Use of the Linux System free command Learn notes

Source: Internet
Author: User

The free command is used to display memory idle and usage for the current system, including physical memory, swap partition memory, kernel buffer memory, and cache, with the parameters of the error:

-b--bytes to show memory usage

[Email protected] ~]# 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 way to show memory usage

[Email protected] ~]# free-k
Total used free shared buffers Cached
mem:509228 135416 373812 0 14320 58892
-/+ buffers/cache:62204 447024
swap:2097144 0 2097144

-m--display the current system memory usage in megabytes

[[email protected] ~]# free-m
              total       used       free      shared    buffers     Cached
mem:            497        132         365          0          13        
-/+ buffers/cache:          60        436
swap:          2047          0        2047

-g--display memory usage in gigabytes

[Email protected] ~]# free-g
Total used free shared buffers Cached
mem:0 0 0 0 0 0
-/+ buffers/cache:0 0
Swap:1 0 1

-o--is displayed in the old format, the so-called old format does not show "-/+ Buffers/cache" line

[Email protected] ~]# Free-o
Total used free shared buffers Cached
mem:509228 135532 373696 0 14340 58892
swap:2097144 0 2097144

-s--specifies how long to refresh once in units: seconds

[[email protected] ~]# free-s 3//Every three seconds refresh

    total       used       Free      shared    buffers     Cached mem:         509228     135772     373456           0      14380      58924-/+ buffers/cache:      62468     446760 Swap:       2097144          0    2097144

Total used free shared buffers cached mem:509228 135788 373440 0 1438 0 58924-/+ buffers/cache:62484 446744 swap:2097144 0 2097144

-c--specifies the number of times to refresh. It is used in conjunction with the-s parameter.

[[email protected] ~]# FREE-S1-C2//per second refresh, total refresh 2 times

total       used       free      shared    buffers     Cached mem:         509228     135772     373456           0      14404      58924-/+ buffers/cache:       62444     446784 swap:      2097144           0    2097144

Total used free shared buffers cached mem:509228 135788 373440 0 1440 4 58924-/+ buffers/cache:62460 446768 swap:2097144 0 2097144

-v--Displays the version of the current system free command

[Email protected] ~]# free-v
Procps version 3.2.8

The more commonly used is free-m or-G, others know it.

Related Article

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.