随笔 - 366  文章 - 0  评论 - 101  阅读 - 30万

随笔分类 -  脚本

按任意键继续
摘要:按任意键继续任意脚本代码:any.sh[root@localhost ~]# cat insert.sh #!/bin/bashget_char(){SAVEDSTTY=`stty -g`stty -echostty cbreakdd if=/dev/tty bs=1 count=1 2> /dev... 阅读全文
posted @ 2015-02-03 13:51 寒星12345678999 阅读(201) 评论(0) 推荐(0) 编辑
*查看进程所消耗的内存*
摘要:转#!/bin/sh mem=`free -m | awk 'NR==2{print $2}'` ps aux | sort -k 4 -r | awk '$4 ~ /^[0-9]/ && $4>0 {print $4,$11}' | awk '{print $1/100*mem" "$2}' me... 阅读全文
posted @ 2015-02-02 14:38 寒星12345678999 阅读(155) 评论(0) 推荐(0) 编辑
test
摘要:test 1 -eq 2 &&echo ok||echo nottest $1 -eq $2 && **||** 阅读全文
posted @ 2015-01-27 11:50 寒星12345678999 阅读(108) 评论(0) 推荐(0) 编辑
shell脚本判断进程是否运行
摘要:zzx@zzx120:~$if ps aux | grep "python"|grep -v grep > /dev/null #$?的值不同then echo "Running"else echo "Stopped"fi如何批量杀掉进程ps -ef |grep java |grep -v grep... 阅读全文
posted @ 2015-01-27 11:45 寒星12345678999 阅读(1293) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示