usage of cut [awk] and xargs of linux commands
alias dierails='ps -a|grep "/usr/local/bin/ruby script/server"|grep -v "grep /usr"|cut -d " " -f1|xargs -n 1 kill -KILL $1'
alias resetrails='ps -a|grep "/usr/local/bin/ruby script/server"|grep -v "grep /usr"|cut -d " " -f1|xargs -n 1 kill -HUP $1'
在dzone.com上看到这个命令alias用以杀掉ruby rails server进程,其中的cut结合xargs或者是awk结合xargs使用相当便捷。
No comments :
Post a Comment