linux 内存、内核、版本查看相关命令

linux 内存、内核、版本查看命令

内存

1、free 查看内容使用情况 (可以加m 转化为Mb h 转化为Gb

total used free shared buffers cached Mem Swap
表示物理 内存总量

表示总计分配给缓存

(包含buffers 与cache )

使用的数量,但其中可能

部分缓存并未实际使用

未被分配的内存 共享内存

系统分配但未被使

用的buffers 数量

系统分配但未被

使用的cached数量

实际使用的buffers总量和cacheed总量

未被使用的buffers 与cache

 和未被分配的内存之和,这

就是系统当前实际可用内存

2、top命令就好像是“linux下的任务管理器”:


然后是列表的含义:

PID 进程ID
USER 进程所有者
PR 优先级
NI nice值,负值表示高优先级,正值表示低优先级
VIRT 进程使用的虚拟内存总量
RES 进程使用的、未被换出的物理内存大小
SHR 共享内存大小
S 进程状态
%CPU 上次更新到现在的CPU时间占用百分比
%MEM 进程使用的物理内存百分比
TIME+ 进程使用CPU总时间
COMMAND 命令名、命令行

3、uptime命令能够打印系统总共运行了多长时间和系统的平均负载。uptime命令可以显示的信息显示依次为:现在时间、系统已经运行了多长时间、目前有多少登陆用户、系统在过去的1分钟、5分钟和15分钟内的平均负载

-V:显示指令的版本信息。

4、vmstat

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0     76 187932 154112 372228    0    0   143    32   36   90  1  1 94  3  0

具体参数如下表:

r The number of processes waiting for run time.   处于运行队列中的内核线程数目(进程数)。
b The number of processes in uninterruptible sleep. 置于等待队列(等待资源、等待输入/输出)的内核线程数目。 处于block队列中不可中断的进程数
swpd the amount of virtual memory used.  可用的虚拟交换内存
free the amount of idle memory. 空闲内存
buff the amount of memory used as buffers. 已用缓冲数目
cache the amount of memory used as cache. 已用缓存数目
si Amount of memory swapped in from disk (/s). 磁盘到内存的交换页数目 (单位/S)
so Amount of memory swapped to disk (/s). 从交换内存到磁盘的交换页数目(单位/S)
bi Blocks received from a block device (blocks/s). 接收到块设备的块数(块/秒)
bo Blocks sent to a block device (blocks/s). 发送到块设备的块数(块/秒)
in The number of interrupts per second, including the clock. 每秒中断数,包括时钟中断
cs The number of context switches per second. 每秒上下文切换数
us Time spent running non-kernel code. (user time, including nice time) 用户时间,处于用户模式的时间百分比
sy Time spent running kernel code. (system time) 系统时间,处于内核模式的时间百分比
id Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. CPU空闲时间,空闲时间百分比
wa Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. CPU 空闲时间,在此期间系统有未完成的磁盘/NFS I/O 请求
wt Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.

来自于虚拟机偷取的CPU所占的百分比(这个不会翻译...)


linux查看内核和版本信息

1)查看当前版本的内核信息

        uname -a


2)linux查看当前操作系统版本信息

        cat /proc/version 


3)Linux查看版本当前操作系统发行版信息

    cat /etc/issue


4)Linux查看cpu相关信息,包括型号、主频、内核信息等

    cat /proc/cpuinfo

      processor        : 0
     vendor_id         : AuthenticAMD
  cpu family        : 15
  model             : 1
  model name      : AMD A4-3300M APU with Radeon(tm) HD Graphics
  stepping         : 0
  cpu MHz          : 1896.236
  cache size       : 1024 KB
  fdiv_bug         : no
  hlt_bug          : no
  f00f_bug        : no
  coma_bug      : no
  fpu                : yes
  fpu_exception   : yes
  cpuid level      : 6
  wp                : yes
  flags             : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr
                           sse sse2 syscall mmxext lm 3dnowext 3dnow
  bogomips      : 3774.87

5)Linux查看版本说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit

        getconf LONG_BIT

32

6)lsb_release 是查看系统版本信息的工具

[root@localhost ~]# lsb_release -a
-bash: lsb_release: command not found

解决方法:yum install redhat-lsb -y

[root@localhost ~]# lsb_release  -a
LSB Version:    :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0- noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 6.0 (Final)
Release:        6.0
Codename:       Final

猜你喜欢

转载自blog.csdn.net/weixin_41782053/article/details/80506104