计算空间
du -h --max-depth=1 /path
连接数
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
文件中计数
tr -cd 'h' <file | wc -c
awk -v RS='haha' 'END {print --NR}' file
查看最大30个文件
ls -Sl -h |head -n 30
查看大于1g,排除特别目录alidata,查看最大目录
du -h --exclude="alidata" --max-depth=1 . |grep 'G'|sort -nr |head -n 30
查看tcp
netstat -na | awk '{print 6}'| sort | uniq -c | sort -n
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
mysql process list
SELECT * FROM information_schema
.PROCESSLIST
where command!='Sleep' ORDER BY TIME
DESC LIMIT 10\G;
网友评论