亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

 更新時間:2014年03月16日 16:39:53   作者:  
今天GoFace給大家介紹linux pidof命令的用法,pidof命令大家或許很少見過,不過在適當?shù)膱龊嫌锰庍€是不小的

一、什么是pidof命令?

復(fù)制代碼 代碼如下:
#man pidof中的解釋:
pidof — find the process ID of a running program.
pidof–用于查找一個運行的程序的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個 pid
-x 表示同時返回運行給定程序的 shell 的 pid
-o 表示告訴 piod 表示忽略后面給定的 pid ,可以使用多個 -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.
如果 是一個 fullpath 則 pidof 不會出錯,但如果不是則有可能返回和給定同名的程序。

三、pidof命令使用實例

復(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)文章

  • 阿里云云服務(wù)器Linux系統(tǒng)掛載數(shù)據(jù)盤圖文教程

    阿里云云服務(wù)器Linux系統(tǒng)掛載數(shù)據(jù)盤圖文教程

    這篇文章主要介紹了阿里云云服務(wù)器Linux系統(tǒng)掛載數(shù)據(jù)盤圖文教程,阿里云服務(wù)器一般需要購買額外的數(shù)據(jù)盤,本文就講解如何掛載使用額外的數(shù)據(jù)盤,需要的朋友可以參考下
    2014-09-09
  • apache偽靜態(tài)與iis偽靜態(tài)規(guī)則與配置區(qū)別介紹

    apache偽靜態(tài)與iis偽靜態(tài)規(guī)則與配置區(qū)別介紹

    本文章來總結(jié)一下關(guān)于apache偽靜態(tài)與iis偽靜態(tài)區(qū)別介紹,主要講到了一些規(guī)則的問題與配置區(qū)別,以后大家就可以直接在iis偽靜態(tài)轉(zhuǎn)換apache,反之也很簡單哦,需要了解的碰可以參考下
    2012-12-12
  • linux讓程序開機自動運行最簡單的方法

    linux讓程序開機自動運行最簡單的方法

    在本篇文章里小編給大家整理的是一篇關(guān)于linux讓程序開機自動運行最簡單的方法以及相關(guān)代碼,需要的朋友們學(xué)習(xí)下。
    2019-11-11
  • 手把手教你在騰訊云上搭建hive3.1.2的方法

    手把手教你在騰訊云上搭建hive3.1.2的方法

    這篇文章主要介紹了手把手教你在騰訊云上搭建hive3.1.2的方法,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-07-07
  • linux vps服務(wù)器進程kswapd0與events/0消耗大量CPU的問題

    linux vps服務(wù)器進程kswapd0與events/0消耗大量CPU的問題

    使用了阿里云的vps服務(wù)器網(wǎng)站宕了兩次機,發(fā)工單給阿里云,發(fā)現(xiàn)原因是服務(wù)器的CPU 100%了,這也是vps的弊端,內(nèi)容給的相對小
    2014-03-03
  • 在 CentOS 8/RHEL 8 上安裝和使用 Cockpit的方法

    在 CentOS 8/RHEL 8 上安裝和使用 Cockpit的方法

    Cockpit 是一個基于 Web 的服務(wù)器管理工具,可用于 CentOS 和 RHEL 系統(tǒng)。最近發(fā)布的 CentOS 8 和 RHEL 8,其中 cockpit 是默認的服務(wù)器管理工具。這篇文章主要介紹了在 CentOS 8/RHEL 8 上安裝和使用 Cockpit的方法,需要的朋友可以參考下
    2019-10-10
  • Linux系統(tǒng)創(chuàng)建TCP連接流程介紹

    Linux系統(tǒng)創(chuàng)建TCP連接流程介紹

    大家好,本篇文章主要講的是Linux系統(tǒng)創(chuàng)建TCP連接流程,感興趣的同學(xué)趕快來看一看吧,對你有幫助的話記得收藏一下哦,方便下次瀏覽
    2021-12-12
  • Apache支持 shtml和include文件解析

    Apache支持 shtml和include文件解析

    這篇文章主要介紹了Apache支持 shtml和include文件解析的相關(guān)資料,需要的朋友可以參考下
    2015-07-07
  • Linux用戶自定義at、cron計劃任務(wù)執(zhí)行的方法

    Linux用戶自定義at、cron計劃任務(wù)執(zhí)行的方法

    今天小編就為大家分享一篇Linux用戶自定義at、cron計劃任務(wù)執(zhí)行的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-07-07
  • 詳解Linux系統(tǒng)無法上網(wǎng)解決方案

    詳解Linux系統(tǒng)無法上網(wǎng)解決方案

    本篇文章主要介紹了詳解Linux系統(tǒng)無法上網(wǎng)解決方案,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-06-06

最新評論