![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
iteye_13002
这个作者很懒,什么都没留下…
展开
-
根据程序名称杀掉所有进程
1 自己写的脚本,结合awk ,ps ,grep, kill #!/bin/bash proccess_name="$1" if [ $# -eq 0 ];then echo 'please input the proccess name!' exit fi pids=`ps -ef|grep ${proccess_name}|awk '{print $2}'` ...原创 2012-04-12 22:28:38 · 259 阅读 · 0 评论 -
Grep 的常用参数和使用
以下是我常用的查找方法,希望对大家有用。欢迎大家补充。 1 查找文件中的内容。一般在日志比极大的时候用grep 很有用 ,下面我说下 我常用的 grep 参数。 当然这样输出的信息很少,有时候需要知道他的上下文。 这时候可以配合 -A -B -C 参数。 -A 就是显示匹配行之后的内容 比如 grep -A 10 'username' log/production.l...2012-04-12 23:22:26 · 150 阅读 · 0 评论 -
Find常用参数和使用
find 常用的参数有 [size] 根据文件大小查找 ,[atime] 根据访问时间查找,[ctime]根据修改时间来查找,[type] 根据 文件类型来查找,[name] 文件名样式。[regex] 文件名的正则表达式 find ./ -type f -name grep.txt # 查找文件名是grep.txt的普通文件 find ./ -type f -regex ".*.[...2012-04-17 22:13:26 · 396 阅读 · 0 评论