查看基础信息
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