一、什么是pidof命令? 代码如下:#man pidof中的解释:pidof ― find the process ID of a running program.pidofC用于查找一个运行的程序的PID。pidof is actually the same program as killall5;[root@GoGo ~]# ls -l /sbin/pidoflrwxrwxrwx. 1 root root 8 Aug 25 00:40 /sbin/pidof -> killall5 //的确如此。二、pidof命令的参数-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 itis possible that it returns pids of running programs that happen to have the same name as the program you're after but areactually other programs.如果 是一个 fullpath 则 pidof 不会出错,但如果不是则有可能返回和给定同名的程序。