Linux冷门却很重要的命令(二)---pgrep
来源:互联网 发布:net域名名站 编辑:程序博客网 时间:2024/06/05 00:27
pgrep命令以名称为依据从运行进程队列中查找进程,并显示查找到的进程id。每一个进程ID以一个十进制数表示,通过一个分割字符串和下一个ID分开,默认的分割字符串是一个新行。对于每个属性选项,用户可以在命令行上指定一个以逗号分割的可能值的集合。
用法:
#pgrep [选项] [程序名]
pgrep [-flvx] [-n | -o] [-d delim] [-P ppidlist] [-g pgrplist] [-s sidlist] [-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist] [-t termlist] [-T taskidlist] [-c ctidlist] [-z zoneidlist] [pattern]
常用参数
-l 列出程序名和进程ID;
-o 进程起始的ID;
-n 进程终止的ID;
实例:
[zhoutimo@server ~]$ pgrep -lo nginx
28233 nginx
[zhoutimo@server ~]$ pgrep -l nginx
28233 nginx
28341 nginx
28442 nginx
28543 nginx
28644 nginx
[zhoutimo@server ~]$ pgrep -ln nginx
28644 nginx
[zhoutimo@server ~]$ pgrep nginx
28433
28541
28542
28543
28544
另外,对比另外一个ps(ps -ef|grep nginx)命令,显得简单迅速。
用法:
#pgrep [选项] [程序名]
pgrep [-flvx] [-n | -o] [-d delim] [-P ppidlist] [-g pgrplist] [-s sidlist] [-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist] [-t termlist] [-T taskidlist] [-c ctidlist] [-z zoneidlist] [pattern]
常用参数
-l 列出程序名和进程ID;
-o 进程起始的ID;
-n 进程终止的ID;
实例:
[zhoutimo@server ~]$ pgrep -lo nginx
28233 nginx
[zhoutimo@server ~]$ pgrep -l nginx
28233 nginx
28341 nginx
28442 nginx
28543 nginx
28644 nginx
[zhoutimo@server ~]$ pgrep -ln nginx
28644 nginx
[zhoutimo@server ~]$ pgrep nginx
28433
28541
28542
28543
28544
另外,对比另外一个ps(ps -ef|grep nginx)命令,显得简单迅速。
2 0
- Linux冷门却很重要的命令(二)---pgrep
- Linux冷门却很重要的命令(九)---dos2unix
- Linux冷门却很重要的命令(一)---iconv
- Linux冷门却很重要的命令(三)---kill(pkill,killall)
- Linux冷门却很重要的命令(四)---sar
- Linux冷门却很重要的命令(五)---exec
- Linux冷门却很重要的命令(六)---chattr(lsattr)
- Linux冷门却很重要的命令(七)---lsof
- Linux冷门却很重要的命令(八)---xargs
- linux pgrep命令的使用
- linux pgrep命令
- linux pgrep命令
- 【Linux基础】管用的小冷门命令
- 冷门却使用的 javascript 技巧
- 一些冷门却有用的小知识
- 每天一个Linux命令-25(pgrep)
- Linux 命令详解---pstree,ps,pgrep,pkill
- Linux pgrep
- ubuntu下孤儿进程的ppid为何不是1?
- 23种设计模式汇总整理
- android 使用java 代码设置 textview的图片
- R语言 我要如何开始R语言
- home live buy
- Linux冷门却很重要的命令(二)---pgrep
- win7 64位,PowerDesigner中导入MYSQL数据库结构的步骤及问题解决
- Leetcode 2. Add Two Numbers
- Android Studio代码检测和性能分析工具
- org.apache.catalina.deploy.WebXml addFilter
- poj3070 Fibonacci(矩阵快速幂)
- 【Codeforces Round 364 (Div 2)C】【前缀和 双指针】They Are Everywhere 含有所有字符的最短区间长度
- EEPROM和FLASH区别
- Hdu 3938 Portal((离线+并查集) (★)