700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Linux命令之pidof

Linux命令之pidof

时间:2021-07-23 06:01:34

相关推荐

Linux命令之pidof

pidof - 找出正在运行程序的进程PID

程序可以是一个二进制执行程序,

也可以是一个shell脚本。

如果是找出java程序的进程PID,pidof就无能为力了,可以使用ps -ef|grep java或jps -l来查看java进程的信息。

通常找出进程PID的目的是确认程序是否在运行、或者为了把它杀掉、或者发送一个信号给它。

参数:

-s 表示只返回1个 pid

-x 表示同时返回运行给定程序的 shell 的 pid

-o 表示告诉 piod 表示忽略后面给定的 pid ,可以使用多个 -o 。

-----------------------------------------------------------------------我是分割线-----------------------------------------------------------------

--killall5 -- send a signal to all processes.

killall5-signalnumber [-oomitpid] [-oomitpid..]

Description

killall5is the SystemV killall command. It sends a signal to all processes exceptkernel threads and the processes in its own session, so it won't kill the shell that is running the script it was called from. Its primary (only) use is in thercscripts found in the /etc/init.d directory.

Notes

killall5can also be invoked as pidof, which is simply a (symbolic) link to thekillall5program.

Exit Status

The program return zero if it killed processes.

It return 2 if no process were killed,

and 1 ifit was unable to find any processes (/proc/ is missing).

---------------------------------------我是分割线------------------------------------------------------

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。