日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux查看进程ppid,pidof命令从运行的进程中以名称查找出进程号PID/PPID横向大到小展示...

發(fā)布時間:2023/12/20 linux 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux查看进程ppid,pidof命令从运行的进程中以名称查找出进程号PID/PPID横向大到小展示... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1.釋義

從運行的進(jìn)程中以名稱查找出進(jìn)程號PID/PPID橫向大到小展示

2.系統(tǒng)幫助

PIDOF(8) Linux System Administrator's Manual PIDOF(8)

NAME

pidof -- find the process ID of a running program.

SYNOPSIS

SYNOPSIS

pidof [-s] [-c] [-n] [-x] [-m] [-o omitpid[,omitpid..]] [-o omitpid[,omitpid..]..] program [program..]

DESCRIPTION

Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. This program is on some systems used in run-level change scripts, especially when the system

has a System-V like rc structure. In that case these scripts are located in /etc/rc?.d, where ? is the runlevel. If the system has a start-stop-daemon (8) program that should be used instead.

OPTIONS

-s Single shot - this instructs the program to only return one pid.

-c Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be unable to check the current root directory of processes

they do not own.

-n Avoid stat(2) system function call on all binaries which are located on network based file systems like NFS. Instead of using this option the the variable PIDOF_NETFS may be set and

exported.

-x Scripts too - this causes the program to also return process id's of shells running the named scripts.

-o omitpid

Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof program, in other words the calling shell or shell script.

-m When used with -o, will also omit any processes that have the same argv[0] and argv[1] as any explicitly omitted process ids. This can be used to avoid multiple shell scripts concurrently

calling pidof returning each other's pids.

EXIT STATUS

0 At least one program was found with the requested name.

1 No program was found with the requested name.

NOTES

pidof is actually the same program as killall5; the program behaves according to the name under which it is called.

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. Note that that the executable name of running processes is calculated with readlink(2), so symbolic links to executables will

also match.

SEE ALSO

shutdown(8), init(8), halt(8), reboot(8), killall5(8)

AUTHOR

Miquel van Smoorenburg, miquels@cistron.nl

3.示例

3.1.以名稱查進(jìn)程號

[root@itbkz ~]#pidof httpd

6557 6556 6555 6554 6553 6552

總結(jié)

以上是生活随笔為你收集整理的linux查看进程ppid,pidof命令从运行的进程中以名称查找出进程号PID/PPID横向大到小展示...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。