查看Linux信息

Linux信息

查看CPU的相关信息

lscpu
[dzlua@ubuntu:~]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 158
Model name:            Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
Stepping:              10
CPU MHz:               2808.001
BogoMIPS:              5616.00
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              9216K
NUMA node0 CPU(s):     0-3
[dzlua@ubuntu:~]$ 

查看内存的相关信息

cat /proc/meminfo |head -20
[dzlua@ubuntu:~]$ cat /proc/meminfo |head -20
MemTotal:        2037232 kB
MemFree:         1485700 kB
Buffers:           64852 kB
Cached:           320120 kB
SwapCached:            0 kB
Active:           266920 kB
Inactive:         131304 kB
Active(anon):      13260 kB
Inactive(anon):      152 kB
Active(file):     253660 kB
Inactive(file):   131152 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4046844 kB
SwapFree:        4046844 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:         13476 kB
Mapped:             6716 kB
Shmem:               164 kB
[root@dev proc]# cat /proc/meminfo
MemTotal:        2037232 kB
MemFree:         1485824 kB
Buffers:           64852 kB
Cached:           320120 kB
SwapCached:            0 kB
Active:           266904 kB
Inactive:         131304 kB
Active(anon):      13244 kB
Inactive(anon):      152 kB
Active(file):     253660 kB
Inactive(file):   131152 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4046844 kB
SwapFree:        4046844 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:         13248 kB
Mapped:             6716 kB
Shmem:               164 kB
Slab:              97036 kB
SReclaimable:      34284 kB
SUnreclaim:        62752 kB
KernelStack:        2704 kB
PageTables:         1716 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5065460 kB
Committed_AS:      64124 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      183512 kB
VmallocChunk:   34359539832 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       12288 kB
DirectMap2M:     1036288 kB
DirectMap1G:     1048576 kB
[dzlua@ubuntu:~]$ 

查看挂接的分区状态

fdisk -l | grep Disk
[dzlua@ubuntu:~]$ fdisk -l | grep Disk
Disk /dev/sda: 107.4 GB, 107374182400 bytes
Disk identifier: 0x0008c221
Disk /dev/mapper/vg_dev-lv_root: 53.7 GB, 53687091200 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_dev-lv_swap: 4143 MB, 4143972352 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_dev-lv_home: 49.0 GB, 49014636544 bytes
Disk identifier: 0x00000000
[dzlua@ubuntu:~]$ 

查看硬盘和分区分布

lsblk
[dzlua@ubuntu:~]$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                        11:0    1 1024M  0 rom
sda                         8:0    0  100G  0 disk
├─sda1                      8:1    0  500M  0 part /boot
└─sda2                      8:2    0 99.5G  0 part
  ├─vg_dev-lv_root (dm-0) 253:0    0   50G  0 lvm  /
  ├─vg_dev-lv_swap (dm-1) 253:1    0  3.9G  0 lvm  [SWAP]
  └─vg_dev-lv_home (dm-2) 253:2    0 45.7G  0 lvm  /home
[dzlua@ubuntu:~]$ 

查看硬盘和分区分布

mount | column -t
[dzlua@ubuntu:~]$ mount | column -t
/dev/mapper/vg_dev-lv_root  on  /                         type  ext4            (rw)
proc                        on  /proc                     type  proc            (rw)
sysfs                       on  /sys                      type  sysfs           (rw)
devpts                      on  /dev/pts                  type  devpts          (rw,gid=5,mode=620)
tmpfs                       on  /dev/shm                  type  tmpfs           (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1                   on  /boot                     type  ext4            (rw)
/dev/mapper/vg_dev-lv_home  on  /home                     type  ext4            (rw)
none                        on  /proc/sys/fs/binfmt_misc  type  binfmt_misc     (rw)
[dzlua@ubuntu:~]$ 

查看硬盘使用情况

df -hT
[dzlua@ubuntu:~]$ df -hT
Filesystem                  Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_dev-lv_root  ext4    50G   12G   35G  26% /
tmpfs                       tmpfs  931M     0  931M   0% /dev/shm
/dev/sda1                   ext4   477M   49M  403M  11% /boot
/dev/mapper/vg_dev-lv_home  ext4    45G   52M   43G   1% /home
[dzlua@ubuntu:~]$ 

查看系统的所有网络接口

ifconfig -a
[dzlua@ubuntu:~]$ ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:0C:29:2B:BE:E5
          inet addr:192.168.5.212  Bcast:192.168.5.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe2b:bee5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:841987 errors:0 dropped:0 overruns:0 frame:0
          TX packets:184594 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:942751394 (899.0 MiB)  TX bytes:99686566 (95.0 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:75 errors:0 dropped:0 overruns:0 frame:0
          TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6052 (5.9 KiB)  TX bytes:6052 (5.9 KiB)
[dzlua@ubuntu:~]$ 

查看系统的键盘和鼠标

cat /proc/bus/input/devices
[dzlua@ubuntu:~]$ cat /proc/bus/input/devices
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=10000000000000 0

I: Bus=0017 Vendor=0001 Product=0001 Version=0100
N: Name="Macintosh mouse button emulation"
P: Phys=
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=mouse0 event1
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3

I: Bus=0011 Vendor=0002 Product=0005 Version=0000
N: Name="ImPS/2 Generic Wheel Mouse"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input2
U: Uniq=
H: Handlers=mouse1 event2
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=103

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input3
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=120013
B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7
[dzlua@ubuntu:~]$ 
posted @ 2019-07-11 18:24  dzlua  阅读(469)  评论(1编辑  收藏  举报