最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux pidof命令使用總結(jié)

 更新時(shí)間:2014年03月16日 16:39:53   作者:  
今天GoFace給大家介紹linux pidof命令的用法,pidof命令大家或許很少見(jiàn)過(guò),不過(guò)在適當(dāng)?shù)膱?chǎng)合用處還是不小的

一、什么是pidof命令?

復(fù)制代碼 代碼如下:
#man pidof中的解釋?zhuān)?BR>pidof — find the process ID of a running program.
pidof–用于查找一個(gè)運(yùn)行的程序的PID。
pidof is actually the same program as killall5;
[root@GoGo ~]# ls -l /sbin/pidof
lrwxrwxrwx. 1 root root 8 Aug 25 00:40 /sbin/pidof -> killall5 //的確如此。

二、pidof命令的參數(shù)
-s 表示只返回1個(gè) pid
-x 表示同時(shí)返回運(yùn)行給定程序的 shell 的 pid
-o 表示告訴 piod 表示忽略后面給定的 pid ,可以使用多個(gè) -o 。
pidof is simply a (symbolic) link to the killall5 program, which should also be located in /sbin.
When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it
is possible that it returns pids of running programs that happen to have the same name as the program you're after but are
actually other programs.
如果 是一個(gè) fullpath 則 pidof 不會(huì)出錯(cuò),但如果不是則有可能返回和給定同名的程序。

三、pidof命令使用實(shí)例

復(fù)制代碼 代碼如下:
[root@GoGo ~]# pidof nginx
1476 1475 1473 1472 1471 1470 1469 1467 1466
[root@GoGo ~]# ps -ef | grep nginx
nginx     1450  1449  0 20:16 ?        00:00:00 php-fpm: pool www
nginx     1451  1449  0 20:16 ?        00:00:00 php-fpm: pool www
nginx     1452  1449  0 20:16 ?        00:00:00 php-fpm: pool www
nginx     1453  1449  0 20:16 ?        00:00:00 php-fpm: pool www
nginx     1454  1449  0 20:16 ?        00:00:00 php-fpm: pool www
root      1466     1  0 20:16 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx     1467  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1469  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1470  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1471  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1472  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1473  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1475  1466  0 20:16 ?        00:00:00 nginx: worker process
nginx     1476  1466  0 20:16 ?        00:00:00 nginx: worker process
root      2234  2141  0 20:24 pts/1    00:00:00 grep nginx
[root@GoGo ~]# ps -ef | grep nginx | awk '{print $2}'
1450
1451
1452
1453
1454
1466
1467
1469
1470
1471
1472
1473
1475
1476
2237
[root@GoGo ~]# pidof -s nginx
1476
[root@GoGo ~]# pidof sshd
2139 1163
[root@GoGo ~]# ps -ef | grep sshd
root      1163     1  0 20:16 ?        00:00:00 /usr/sbin/sshd
root      2139  1163  0 20:20 ?        00:00:00 sshd: root@pts/1

相關(guān)文章

最新評(píng)論

商丘市| 辽阳县| 抚远县| 儋州市| 久治县| 宁津县| 洞口县| 中方县| 芜湖县| 建阳市| 河间市| 福州市| 宜宾县| 陵水| 南召县| 衡阳县| 宕昌县| 邓州市| 蓬溪县| 铜川市| 乌拉特中旗| 太仓市| 秭归县| 华池县| 周口市| 侯马市| 芜湖市| 玉林市| 堆龙德庆县| 崇明县| 天台县| 象山县| 邵武市| 靖江市| 平遥县| 介休市| 龙胜| 吐鲁番市| 同仁县| 赫章县| 扶沟县|