mpstat用于报告多路CPU主机的每颗CPU活动情况,以及整个主机的CPU情况。
下边的命令可以隔2秒报告一次处理器的活动情况,执行3次
[root@localhost ~]# mpstat 2 3
如下命令每隔1秒显示一次多路CPU主机的处理器活动情况,执行3次
[root@localhost ~]# mpstat -P ALL 1 3
————————————————————————————————————————————————————————————————————————
在当前目录下列出所有的扩展名
[root@localhost ~]# find . -type f | awk -F'.' '{print $NF}' | sort| uniq -c | sort -g
——————————————————————————————————————————————————————
批量替换php中的关键字 for I in `find . -name "*.php"`; do sed -i "s/old name/new name/g" $I; done
—————————————————————————————————————————————————
_____________________________________________________________________________________________________________________
————————————————————————————————————————————————
—————————————————————————————————————————————————
—————————————————————————————————————————————————
————————————————————————————————————————————
用脚本获取eth0上的IPv4地址[root@localhost ~]# ip addr show eth0 |grep 'inet\b' |awk '{print $2}' |sed -r -e 's/\/.*?//g'
—————————————————————————————————————————————————
—————————————————————————————————————————————————
统计服务器上已经建立的TPC的链接
[root@localhost ~]# netstat -an | awk '$1 ~ /[Tt][Cc][Pp]/ && $NF ~ /ESTABLISHED/{i++}END{print "Connected:\t", i}'
——————————————————————————————————————————————————————————
限制传输速率[root@localhost ~]# cat /dev/urandom | pv -L 3m | dd bs=1M count=100 iflag=fullblock > /dev/null
————————————————————————————————————————————————————
————————————————————————————————————————————————————————
备份制定后缀的文件并且打包到根目录下 [root@localhost opt]# tar --exclude=".??*" -zcvf ./home_backup_2008.tar.gz my_home
——————————————————————————————————————————————————————————
——————————————————————————————————————————————————————————
Linux 限制传输速率 cat /dev/urandom | pv -L 3m | dd bs=1M count=100 iflag=fullblock > /dev/null
——————————————————————————————————————————————————————
格式化另一个日期 date --date=yesterday +%Y%m%d
————————————————————————————————————————————————————————
合并多个文件到一个文件中 cat file1 . . . fileN > NEWFile
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
————————————————————————————————————————————————————————
——————————————————————————————————————————————————
————————————————————————————————————————————————————
————————————————————————————————————————————————————
————————————————————————————————————————————————————
————————————————————————————————————————————————————
————————————————————————————————————————————————————
[root@localhost ~]# ssh 192.168.83.229 "tail -f /opt/file.txt"
————————————————————————————————————————————————————
————————————————————————————————————————————————————
————————————————————————————————————————————————————————
寻找最大的10个文件夹
[root@localhost ~]# find . -type d -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {} | sort -rn
______________________________________________________________________________________________________________________________________________
_________________________________________________________________________________________________________________________________________________
——————————————————————————————————————————————————————————————————
——————————————————————————————————————————————————————————————————————
列出所有zip压缩包里边的文件并解压 [root@localhost opt]# find . -name "*.tgz" -or -name "*.zip" | while read file; do echo "$file:"; unzip $file; done
——————————————————————————————————————————————————————————————————————————
————————————————————————————————————————————————————————————————————————————
——————————————————————————————————————————————————————————————————————————————
————————————————————————————————————————————————————————————————————————
————————————————————————————————————————————————————————————————————————————————-
生成一个随机MAC地址 : [root@localhost ~]# od -An -N10 -x /dev/random | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'
——————————————————————————————————————————————————————————————————————————————————
————————————————————————————————————————————————————————————————————————
——————————————————————————————————————————————————————————————————————————————
查看是32还是64 [17:33:14 root:/tmp 173] # grep " lm " /proc/cpuinfo > /dev/null && echo "64-bit" || echo "32-bit"
待续。。。
————————————————————————————————————————————————————————————————————————————
相关推荐
Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06Linux-shell编程06
本文主要对linux-shell脚本命令中的grep命令进行简介,希望对您有所帮助。
本文主要对linux-shell脚本命令中的awk命令进行简单介绍,希望对您有所帮助。
本文主要是对linux-shell脚本命令中的sed命令进行简单介绍。
Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell编程05Linux-shell...
Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell编程07Linux-shell...
Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell编程03Linux-shell...
Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08Linux-shell编程08
Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02Linux-shell编程02
Linux-shell编程04Linux-shell编程04Linux-shell编程04Linux-shell编程04Linux-shell编程04Linux-shell编程04Linux-shell编程04Linux-shell编程04Linux-shell编程04
linux-shell公司内部分享,实战分享
linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01linux-shell编程基础01
mysql linux shell
11.2.1 Shell编程-字符截取命令-cut命令.mp4 11.2.2 Shell编程-字符截取命令-printf命令.mp4 11.2.3 Shell编程-字符截取命令-awk命令.mp4 11.2.4 Shell编程-字符截取命令-sed命令.mp4 11.3 Shell编程-字符处理...
Linux -shell命令思维导图
Linux-shell脚本全面学习.pdf
linux-shell-scripting-fundamentals-bash.epub
如果你不会写linux-shell脚本,那么请你学习linux-shell脚本全面学习资料
linux_shell命令集
linux -shell手册.PDFlinux -shell手册.PDF