Linux常用命令

uname -a # 查看操作系统详情
Linux VM-10-10-centos 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
hostname # 查看主机名称
VM-10-10-centos
more /etc/redhat-release # 查看系统发行版本
CentOS Linux release 7.9.2009 (Core)
lscpu # 查看CPU信息
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            23
Model:                 49
Model name:            AMD EPYC 7K62 48-Core Processor
Stepping:              0
CPU MHz:               2595.124
BogoMIPS:              5190.24
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              4096K
L3 cache:              16384K
NUMA node0 CPU(s):     0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid eagerfpu 
pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext retpoline_amd ibpb 
vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 arat
free -h # 查看内存,并以人类可读的方式显示空间单位
                  total        used        free      shared  buff/cache   available
Mem:           2.0G        849M         91M        592K        1.0G        980M
Swap:            0B          0B          0B
grep -n release /etc/redhat-release # 过滤出文件中包含“release”字符的行
1:CentOS Linux release 7.9.2009 (Core)
grep -nA 15 release /etc/redhat-release # 过滤出文件中包含“release”字符的行,并显示其下的15行
1:CentOS

```shell
tail -f logs/csp/sentinel.log.2017-06-08 | grep 12 # 实时滚动过滤显示日志文件的新增内容,过滤条件是显示包含“12”的行
du -sh ./* # 查看当前目录下的所有文件及子目录大小
du -sh ./ # 查看当前目录的总占用大小
df -h # 查看磁盘、挂载点、文件等的占用
cat nohup.out | tail -n +1000 | head -n 3 # 从nohup.out文件的第1000行开始,显示3行
posted @ 2022-06-12 23:51  JaxYoun  阅读(27)  评论(0编辑  收藏  举报