21xrx.com
登录
文章检索 我的文章 写文章
linux查看系统信息的命令有哪些
2020-11-12 15:20:58 深夜i     --     --
查看linux系统信息

uname

常用参数搭配:uname -a

root@hecs-x-large-2-linux-20201111114340:~# uname -a
Linux hecs-x-large-2-linux-20201111114340 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

从uname中貌似确实看到了许多信息,但是好像并不是我想要的,没有哪个系统的哪个版本

lsb_release

常用参数搭配:lsb_release -a

root@hecs-x-large-2-linux-20201111114340:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic

free

查看内存信息

root@hecs-x-large-2-linux-20201111114340:~# free
              total        used        free      shared  buff/cache   available
Mem:        4038792      188480     2867324        7472      982988     3592068
Swap:             0           0           0

top

实时监控系统的cpu和内存,默认3s刷新一次

top - 15:14:52 up 19:26,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  98 total,   1 running,  54 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  0.0 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  4038792 total,  2867264 free,   188228 used,   983300 buff/cache
KiB Swap:        0 total,        0 free,        0 used.  3592308 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
20150 root      20   0   41820   3752   3152 R   0.3  0.1   0:00.04 top
    1 root      20   0  159960   9248   6740 S   0.0  0.2   0:02.04 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/0:0H
    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_wq
    7 root      20   0       0      0      0 S   0.0  0.0   0:00.07 ksoftirqd/0
    8 root      20   0       0      0      0 I   0.0  0.0   0:02.63 rcu_sched
    9 root      20   0       0      0      0 I   0.0  0.0   0:00.00 rcu_bh
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/0
   11 root      rt   0       0      0      0 S   0.0  0.0   0:00.09 watchdog/0
   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/0
   13 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/1
   14 root      rt   0       0      0      0 S   0.0  0.0   0:00.07 watchdog/1
   15 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/1
   16 root      20   0       0      0      0 S   0.0  0.0   0:00.06 ksoftirqd/1
   18 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/1:0H
   19 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kdevtmpfs
   20 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 netns
   21 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_tasks_kthre
   22 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kauditd
   25 root      20   0       0      0      0 S   0.0  0.0   0:00.02 khungtaskd
   26 root      20   0       0      0      0 S   0.0  0.0   0:00.00 oom_reaper
   27 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 writeback
   28 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kcompactd0
   29 root      25   5       0      0      0 S   0.0  0.0   0:00.00 ksmd
   30 root      39  19       0      0      0 S   0.0  0.0   0:00.00 khugepaged
   31 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 crypto
   32 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kintegrityd
   33 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kblockd
   34 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 ata_sff
   35 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 md
   36 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 edac-poller
   37 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 devfreq_wq
   38 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 watchdogd
   41 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kswapd0
   42 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/u5:0
   43 root      20   0       0      0      0 S   0.0  0.0   0:00.00 ecryptfs-kthrea
   85 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kthrotld
   86 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 acpi_thermal_pm
   87 root      20   0       0      0      0 I   0.0  0.0   0:00.86 kworker/1:2
   88 root      20   0       0      0      0 S   0.0  0.0   0:00.00 scsi_eh_0
   89 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 scsi_tmf_0
   90 root      20   0       0      0      0 S   0.0  0.0   0:00.00 scsi_eh_1
   91 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 scsi_tmf_1
   97 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 ipv6_addrconf
  106 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kstrp
  123 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 charger_manager
  174 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 ttm_swap
  273 root       0 -20       0      0      0 I   0.0  0.0   0:00.10 kworker/1:1H
  280 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 raid5wq
  335 root      20   0       0      0      0 S   0.0  0.0   0:00.81 jbd2/vda1-8
  336 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 ext4-rsv-conver
  386 root       0 -20       0      0      0 I   0.0  0.0   0:00.31 kworker/0:1H
  409 root      19  -1   94876  14528  13792 S   0.0  0.4   0:00.15 systemd-journal
  418 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 iscsi_eh
  426 root      20   0   97708   1816   1636 S   0.0  0.0   0:00.00 lvmetad

df

查看硬盘使用情况

root@hecs-x-large-2-linux-20201111114340:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           395M  7.3M  388M   2% /run
/dev/vda1        40G  4.7G   33G  13% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           395M     0  395M   0% /run/user/0

 

  
  

评论区

{{item['qq_nickname']}}
()
回复
回复