Linux pidof Command Usage Summary

Source: Internet
Author: User
Tags fpm

  Today Goface to introduce the use of the Linux pidof command, pidof command you may rarely see, but in the appropriate situation is not small use of the

One, what is Pidof order?     Code is as follows: #man pidof: Pidof-find The process ID of a running program. pidof– is used to find the PID of a running program. Pidof is actually the same program as KILLALL5; [Root@gogo ~]# ls-l/sbin/pidof lrwxrwxrwx. 1 root root 8 Aug 00:40/sbin/pidof-> killall5//indeed. The parameter-s of the PIDOF command returns only 1 pid-x that returns the shell that runs the given program at the same time, and tells Piod to ignore the PID given later and can use multiple-O. Pidof is simply a (symbolic) link to the KILLALL5 program, which should the also of be located in/sbin. When pidof are invoked with a full pathname to the "program" it should find the PID of, it's reasonably safe. Otherwise it is possible this it returns PIDs of running programs that happen to have the same name as the program for you ' re After the but are actually other programs. If it is a fullpath, pidof does not make an error, but it is possible to return and give a program with the same name if it is not. The   PIDOF command uses the instance code as follows: [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?       &NBsp;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     146 7  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? &nbSp      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 &nb Sp  00:00:00 grep nginx [Root@gogo ~]# ps-ef | grep Nginx | awk ' {print $} ' 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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.