Linux 常用基础命令

查看基础信息

cpu相关

查看cpu型号
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
8  Intel(R) Xeon(R) CPU E5-2603 v2 @ 1.80GHz
查看物理cpu个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2
查看每个cpu中core个数(核数)
cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores    : 4
查看逻辑cpu个数
cat /proc/cpuinfo| grep "processor"| wc -l
8

最耗cpu线程

top -Hp pid

内存相关

查看内存使用率
free    
         total       used       free     shared    buffers     cached
Mem:     115581072   26332072   89249000          0    1121876   21382456
-/+ buffers/cache:    3827740  111753332
Swap:      8191992          0    8191992
查看内存总数
#cat /proc/meminfo | grep MemTotal
MemTotal: 32941268 kB //内存32G

查看出口ip    curl ifconfig.me 
磁盘空间      df -hT
查看总cpu     cat /proc/cpuinfo | grep "model name" && cat /proc/cpuinfo |grep "physical id"
查看总内存    cat /proc/meminfo | grep MemTotal
查看网卡带宽  sudo ethtool eth1
查看带宽      mii-tool -v
cpu使用率     top -bn 1 -i -c
内存使用率    free
  curl www.baidu.com | iconv -f utf-8 -t gbk
  ps -ef |grep java
虚拟机堆栈线程日志输出文件   jstack -l 10173 >> dumpFile
监控查询  tail -500f nohup.out |grep ''
最耗cpu线程 top -Hp pid
查看系统限制个数 
ulimit -n
查看当前打开文件数
lsof -p pid|wc -l
vim /etc/profile
ulimit -n 65535
source /etc/profile
查看当前目录下的文件数量(不包含子目录中的文件)
ls -l|grep "^-"| wc -l
 查看当前目录下的文件数量(包含子目录中的文件) 注意:R,代表子目录
ls -lR|grep "^-"| wc -l







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值