linux shell编程入门--查看系统环境信息

2021-01-25  本文已影响0人  Seurat_Satija

查看系统环境信息是生信技能树[生信爆款入门课程]linux shell编程部分Day15的讲到的一个重要知识点。为加深理解,现在对几个常用函数做下练习巩固。

1.常用命令简介

image.png

2.操作练习

2.1 查看cpu信息

(base) Last10 00:47:55 ~
$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    8
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 94
Model name:            Intel(R) Xeon(R) Gold 61xx CPU
Stepping:              3
CPU MHz:               2494.130
BogoMIPS:              4988.26
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              4096K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single kaiser fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap xsaveopt xsavec xgetbv1 arat
(base) Last10 00:51:48 ~

2.2 查看内存信息

(base) Last10 00:51:48 ~
$ free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        2.0G        742M        153M         12G         12G
Swap:            0B          0B          0B
(base) Last10 00:53:57 ~
$ 

2.3 查看硬盘信息

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
tmpfs           1.6G  154M  1.5G  10% /run
/dev/vda1        50G   20G   28G  41% /
tmpfs           7.8G   28K  7.8G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/vdd1       493G  266G  202G  57% /trainee1
/dev/vdc1       493G  364G  104G  78% /trainee2
/dev/vde1       148G   91G   50G  65% /teach
tmpfs           1.6G     0  1.6G   0% /run/user/1003
tmpfs           1.6G     0  1.6G   0% /run/user/1027
tmpfs           1.6G     0  1.6G   0% /run/user/1011
tmpfs           1.6G     0  1.6G   0% /run/user/1057
tmpfs           1.6G     0  1.6G   0% /run/user/1074
tmpfs           1.6G     0  1.6G   0% /run/user/1080
tmpfs           1.6G     0  1.6G   0% /run/user/1103
tmpfs           1.6G     0  1.6G   0% /run/user/1101
tmpfs           1.6G     0  1.6G   0% /run/user/1093
tmpfs           1.6G     0  1.6G   0% /run/user/1091
tmpfs           1.6G     0  1.6G   0% /run/user/1125
tmpfs           1.6G     0  1.6G   0% /run/user/1131
tmpfs           1.6G     0  1.6G   0% /run/user/1172
tmpfs           1.6G     0  1.6G   0% /run/user/1173
tmpfs           1.6G     0  1.6G   0% /run/user/1157
tmpfs           1.6G     0  1.6G   0% /run/user/1207
tmpfs           1.6G     0  1.6G   0% /run/user/1226
tmpfs           1.6G     0  1.6G   0% /run/user/1213
tmpfs           1.6G     0  1.6G   0% /run/user/1217
(base) Last10 00:54:58 ~
$ 

4.查看文件大小

(base) Last10 00:56:24 ~
$ du -sh
4.4G    

5.查看系统进程

$ top
top - 01:01:20 up 708 days, 14:10,  3 users,  load aver
Tasks: 295 total,   1 running, 293 sleeping,   0 stoppe
%Cpu(s):  0.1 us,  0.1 sy,  0.0 ni, 99.8 id,  0.0 wa,  
KiB Mem : 16300696 total,   671908 free,  2134460 used,
KiB Swap:        0 total,        0 free,        0 used.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU 
21802 root      20   0  510008  16292   3608 S   0.3 
25990 Last10    20   0   92972   4564   3600 S   0.3 
27998 Last10    20   0   40940   3752   3036 R   0.3 
    1 root      20   0  119956   5224   3188 S   0.0 
    2 root      20   0       0      0      0 S   0.0 
    3 root      20   0       0      0      0 S   0.0 
    5 root       0 -20       0      0      0 S   0.0 
    7 root      20   0       0      0      0 S   0.0 
    8 root      20   0       0      0      0 S   0.0 
    9 root      rt   0       0      0      0 S   0.0 
ctrl+c退出
htop
image.png
上一篇 下一篇

猜你喜欢

热点阅读