User-Profile-Image
hankin
  • 5
  • centos7
  • docker
  • mysql
  • PostgreSQL
  • git/gitlab
  • ELK
  • python
    • python-Tornado
    • python-django
  • redis
  • nginx
  • kvm
  • proxmox
  • mongo
  • kubernetes
  • prometheus
  • GlusterFs
  • nfs
  • freeswitch
  • httpd
  • shell脚本
  • linux
  • fastdfs
  • nextcloud
  • openssl
  • openvpn
  • rabbitmq
  • sqlite
  • svn
  • java
  • ubuntu
  • vue2
  • wordpress
  • php
  • IOT物联网
  • 项目
  • 故障处理
  • 树莓派
  • 博客存档
  • 未分类
  • 杂项
  • #1742(无标题)
  • 新视野
  • 分类
    • 项目
    • 树莓派
    • 杂项
    • 未分类
    • 新视野
    • 故障处理
    • 博客存档
    • 交换机
    • wordpress
    • vue2
    • ubuntu
    • svn
    • sqlite
    • shell脚本
    • redis
    • rabbitmq
    • python-django
    • python
    • proxmox
    • prometheus
    • PostgreSQL
    • php
    • openvpn
    • openssl
    • nginx
    • nfs
    • nextcloud
    • mysql
    • mongo
    • linux
    • kvm
    • kubernetes
    • java
    • IOT物联网
    • httpd
    • GlusterFs
    • git/gitlab
    • freeswitch
    • fastdfs
    • ELK
    • docker
    • centos7
  • 页面
    • #1742(无标题)
  • 友链
      请到[后台->主题设置->友情链接]中设置。
Help?

Please contact us on our email for need any support

Support
    首页   ›   centos7   ›   正文
centos7

linux-centos7系统常用-查询查看

2022-11-02 15:19:42
716  0 0
查使用内存最多的10个进程
ps -aux | sort -k4nr | head -n 10
查使用CPU最多的10个进程
ps -aux | sort -k3nr | head -n 10
查看DNS
    cat /etc/resolv.conf            
统计文件数量
    统计当前文件夹下文件的个数,包括子文件夹里的 :                
        ls -lR|grep "^-"|wc -l          
    统计文件夹下目录的个数,包括子文件夹里的:               
        ls -lR|grep "^d"|wc -l          
            grep "^-" :只保留一般文件,如果只保留目录就是 ^d     
文件内容求和
awk '{sum+=$1} END{print sum}' a.txt
查看网络端口连接数
    netstat -nat | grep -i 80 | wc -l               
    ss -nat | grep -i 80 | wc -l                
文件描述符数,进程限制,打开文件显示
    查看 进程打开文件数              
        ls /proc/21193/fd/ | wc -l          

    查看系统文件描述符数量             
        cat /proc/sys/fs/file-max           
        sysctl -a |grep fs.file-max         
            默认值是系统自动设置,内存大小(KB)的10%     
    查看/修改用户文件描述符数量              
        ulimit -n   默认1024      
查看cpu温度
    cat /sys/devices/virtual/thermal/thermal_zone0/temp 
    cat /sys/devices/virtual/thermal/thermal_zone1/temp 
查看cpu信息
    lscpu   或           
    cat /proc/cpuinfo               
        processor       逻辑处理器的id。       
        physical id     物理封装的处理器的id。        
        core id         每个核心的id。        
        cpu cores       位于相同物理封装的处理器中的内核数量。     
        siblings    位于相同物理封装的处理器中的逻辑处理器的数量。     

    查看物理CPU的个数              
        cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc –l          
    查看逻辑CPU的个数              
        cat /proc/cpuinfo |grep "processor"|wc –l           
    查看CPU是几核                
        cat /proc/cpuinfo |grep "cores"|uniq            
    查看CPU的主频                
        cat /proc/cpuinfo |grep MHz|uniq            
    查看CPU信息(型号)             
        cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c           

        说明              
        processor   系统中逻辑处理核的编号。对于单核处理器,则课认为是其CPU编号,对于多核处理器则可以是物理核、或者使用超线程技术虚拟的逻辑核          
        vendor_id   CPU制造商                  
        cpu family  CPU产品系列代号           
        model       CPU属于其系列中的哪一代的代号            
        model name  CPU属于的名字及其编号、标称主频           
        stepping    CPU属于制作更新版本         
        cpu MHz     CPU的实际使用主频          
        cache size  CPU二级缓存大小           
        physical id 单个CPU的标号            
        siblings    单个CPU逻辑物理核数         
        core id 当前物理核在其所处CPU中的编号,这个编号不一定连续          
        cpu cores   该逻辑核所处CPU的物理核数          
        apicid  用来区分不同逻辑核的编号,系统中每个逻辑核的此编号必然不同,此编号不一定连续          
        fpu 是否具有浮点运算单元(Floating Point Unit)         
        fpu_exception   是否支持浮点计算异常          
        cpuid level 执行cpuid指令前,eax寄存器中的值,根据不同的值cpuid指令会返回不同的内容          
        wp  表明当前CPU是否在内核态支持对用户空间的写保护(Write Protection)          
        flags   当前CPU支持的功能          
        bogomips    在系统内核启动时粗略测算的CPU速度(Million Instructions Per Second)         
        clflush size    每次刷新缓存的大小单位         
        cache_alignment     缓存地址对齐单位            
        address sizes   可访问地址空间位数           
        power management    对能源管理的支持,有以下几个可选支持功能:           
查看磁盘
    分区工具查看分区信息      
    fdisk -l        

    显示物理卷、卷组、逻辑卷信息      
    pvs, vgs, lvs       

    查看磁盘、分区,显示设备块       
    lsblk       

    查看开机信息里面的磁盘info     
    dmesg       

    查看已挂装的文件系统      
    findmnt     

    显示磁盘空余      
    df -Ph   = df -h    
查看内存
    free -m 或       
    cat /proc/meminfo           

    说明          
    MemTotal:            //总内存      
    MemFree:             //空闲内存     
    Buffers:             //给文件的缓冲大小     
    Cached:              //高速缓冲存储器(http://baike.baidu.com/view/496990.htm)使用的大小     
    SwapCached:          //被高速缓冲存储用的交换空间大小      
    Active:              //活跃使用中的高速缓冲存储器页面文件大小      
    Inactive:            //不经常使用的高速缓冲存储器页面文件大小      
    Active(anon):        //anon:不久      
    HighTotal:           //The total and free amount of memory, in kilobytes, that is not directly mapped into kernel space.        
    HighFree:            // The HighTotal value can vary based on the type of kernel used.      
    LowTotal:            // The total and free amount of memory, in kilobytes, that is directly mapped into kernel space.  used.        
    LowFree:             //The LowTotal value can vary based on the type of kernel      
    SwapTotal:           //交换空间总大小      
    SwapFree:            //空闲交换空间       
    Dirty:               //等待被写回到磁盘的大小      
    Writeback:           //正在被写回的大小     
    AnonPages:           //未映射的页的大小     
    Mapped:              //设备和文件映射的大小       
    Slab:                //内核数据结构缓存的大小,可减少申请和释放内存带来的消耗      
    SReclaimable:        //可收回slab的大小       
    SUnreclaim:          //不可收回的slab的大小23204+14164=37368        
    PageTables:          //管理内存分页的索引表的大小        
    NFS_Unstable:        //不稳定页表的大小     
    Bounce:              //bounce:退回        
    WritebackTmp:        //     
    VmallocTotal:        //虚拟内存大小       
    VmallocUsed:         //已经被使用的虚拟内存大小     
    HugePages_Total:       0 //大页面的分配           
    HugePages_Free:        0            
    HugePages_Rsvd:        0            
    HugePages_Surp:        0            
评论 (0)

点击这里取消回复。

欢迎您 游客  

Copyright © 2025 网站备案号 : 蜀ICP备2022017747号
smarty_hankin 主题. Designed by hankin
主页
页面
  • #1742(无标题)
博主
tang.show
tang.show 管理员
linux、centos、docker 、k8s、mysql等技术相关的总结文档
213 文章 2 评论 201664 浏览
测试
测试