感谢支持
我们一直在努力

11 条Linux/Unix 管理员常用命令

1-保存man-page 为pdf文件


man -t awk | ps2pdf – awk.pdf


2-Duplicate installed packages from one machine to the other (RPM-based systems)


ssh root@remote.host “rpm -qa” | xargs yum -y install


3-Stamp a text line on top of the pdf pages to quickly add some remark, comment, stamp text, … on top of (each of) the pages of the input pdf file


echo “This text gets stamped on the top of the pdf pages.” | enscript -B -f Courier-Bold16 -o- | ps2pdf – | pdftk input.pdf stamp – output output.pdf


4-Display the number of connections to a MySQL Database


mysql -u root -p -BNe “select host,count(host) from processlist group by host;” information_schema


5-Create a local compressed tarball from remote host directory


ssh user@host “tar -zcf – /path/to/dir” > dir.tar.gz


6-tail a log over ssh


ssh -t remotebox “tail -f /var/log/remote.log”


7-Print diagram of user/groups


awk ‘BEGIN{FS=”:”; print “digraph{“}{split($4, a, “,”); for (i in a) printf “\”%s\” [shape=box]\n\”%s\” -> \”%s\”\n”, $1, a[i], $1}END{print “}”}’ /etc/group|display


8-Draw kernel module dependancy graph.


lsmod | perl -e ‘print “digraph \”lsmod\” {“;;while(){@_=split/\s+/; print “\”$_[0]\” -> \”$_\”\n” for split/,/,$_[3]}print “}”‘ | dot -Tpng | display –


9-Create strong, but easy to remember password


read -s pass; echo $pass | md5sum | base64 | cut -c -16


10-Find all files larger than 500M and less than 1GB


find / -type f -size +500M -size -1G


11-Limit the cpu usage of a process


sudo cpulimit -p pid -l 50


很有“一行帝”风范啊~~

赞(0) 打赏
转载请注明出处:服务器评测 » 11 条Linux/Unix 管理员常用命令
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏