The 'free' command on CentOS 6 and CentOS 7 exhibits key differences in output format and available options. Here's a breakdown of these variations:

Output Format

On CentOS 6, the 'free' command displays memory usage in the following format:

             total       used       free     shared    buffers     cached
Mem:       1012452     948276      64388          0      68952     527660
-/+ buffers/cache:     352664     659788
Swap:      2064376       6676    2057700

CentOS 7 presents a revised output format for 'free':

              total        used        free      shared  buff/cache   available
Mem:        1000000      200000      300000       40000      500000      600000
Swap:       2000000      100000     1900000

Notable Changes

  • CentOS 7 eliminates the 'buffers' and 'cached' columns, replacing them with a single 'buff/cache' column that shows the combined memory used for buffering and caching.

  • A new 'available' column is introduced in CentOS 7, reflecting the amount of physical memory currently available for use.

Options

In CentOS 6, the 'free' command supports options like '-b', '-k', '-m', and '-g' to specify output units in bytes, kilobytes, megabytes, and gigabytes respectively. CentOS 7 discontinues these options and sets the default output to be in bytes.

Conclusion

Although the output format and options have evolved, both CentOS 6 and CentOS 7 versions of the 'free' command provide valuable insights into system memory usage.

CentOS 6 vs. CentOS 7: free Command Differences

原文地址: https://www.cveoy.top/t/topic/lEfL 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录