美文网首页
获取系统基本信息的命令_CentOS 7

获取系统基本信息的命令_CentOS 7

作者: 082e63dc752b | 来源:发表于2021-03-15 23:36 被阅读0次

    获取系统基本信息的命令

    1. 查看系统版本
    [root@localhost ~]# cat /etc/redhat-release 
    CentOS Linux release 7.8.2003 (Core)
    
    1. 查看cpu信息
    [root@localhost ~]# cat /proc/cpuinfo 
    processor   : 0
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 69
    model name  : Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz
    stepping    : 1
    microcode   : 0x25
    cpu MHz     : 2394.462
    cache size  : 3072 KB
    physical id : 0
    siblings    : 4
    core id     : 0
    cpu cores   : 4
    apicid      : 0
    initial apicid  : 0
    
    1. 查看ip地址
    [root@localhost ~]# ifconfig ens33
    ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 1.1.2.128  netmask 255.255.255.0  broadcast 1.1.2.255
            inet6 fe80::23a8:e0f:bc9f:358  prefixlen 64  scopeid 0x20<link>
            ether 00:0c:29:47:d4:00  txqueuelen 1000  (Ethernet)
            RX packets 418  bytes 49204 (48.0 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 249  bytes 40060 (39.1 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    1. 查看系统内存、虚拟内存的大小及占用情况
    [root@localhost ~]# free -h
                  total        used        free      shared  buff/cache   available
    Mem:           1.8G        641M        373M         26M        804M        997M
    Swap:          2.0G          0B        2.0G
    
    
    1. 系统启动时的系统cpu、内存、网卡等信息。启动后可以用dmesg来查看,该命令用实例名和物理名称 来标识连到系统上的设备,也用于显示系统诊断信息,操作系统版本号,物理内存大小以及其他信息。
    [root@localhost ~]# dmesg | more
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 3.10.0-1127.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020
    [    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-1127.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-
    8
    [    0.000000] Disabled fast string operations
    [    0.000000] e820: BIOS-provided physical RAM map:
    [    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ebff] usable
    [    0.000000] BIOS-e820: [mem 0x000000000009ec00-0x000000000009ffff] reserved
    [    0.000000] BIOS-e820: [mem 0x00000000000dc000-0x00000000000fffff] reserved
    [    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007fedffff] usable
    [    0.000000] BIOS-e820: [mem 0x000000007fee0000-0x000000007fefefff] ACPI data
    
    1. 查看当前的进程
    [root@localhost ~]# ps -ef
    UID         PID   PPID  C STIME TTY          TIME CMD
    root          1      0  0 23:15 ?        00:00:04 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
    root          2      0  0 23:15 ?        00:00:00 [kthreadd]
    root          4      2  0 23:15 ?        00:00:00 [kworker/0:0H]
    root          6      2  0 23:15 ?        00:00:00 [ksoftirqd/0]
    root          7      2  0 23:15 ?        00:00:00 [migration/0]
    root          8      2  0 23:15 ?        00:00:00 [rcu_bh]
    root          9      2  0 23:15 ?        00:00:03 [rcu_sched]
    root         10      2  0 23:15 ?        00:00:00 [lru-add-drain]
    root         11      2  0 23:15 ?        00:00:00 [watchdog/0]
    root         12      2  0 23:15 ?        00:00:00 [watchdog/1]
    root         13      2  0 23:15 ?        00:00:00 [migration/1]
    root         14      2  0 23:15 ?        00:00:00 [ksoftirqd/1]
    root         16      2  0 23:15 ?        00:00:00 [kworker/1:0H]
    

    相关文章

      网友评论

          本文标题:获取系统基本信息的命令_CentOS 7

          本文链接:https://www.haomeiwen.com/subject/xhxrcltx.html