Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the pidof command in the Linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I'll tell you what the pidof command is in the Linux system. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

Pidof is suitable for finding the process number of a running process in Linux system, and its function is similar to that of pgrep and ps.

# ls-l / sbin/pidof

Lrwxrwxrwx. 1 root root 18 Oct 15 2017 / sbin/pidof-> / usr/sbin/killall5

Grammar

Pidof (option) (parameter)

Option

-s: only one process number is returned

-c: only processes with the same "root" directory are displayed

-x: displays the processes started by the script

-o: specifies the process ID that is not displayed.

Parameters.

Process name: specifies the name of the process to find.

Example

# pidof nginx

3189 985 984 983 982

# ps-ef | grep nginx

Work 982 3189 0 02:02? 00:00:00 nginx: worker process

Work 983 3189 0 02:02? 00:00:02 nginx: worker process

Work 984 3189 0 02:02? 00:00:02 nginx: worker process

Work 985 3189 0 02:02? 00:00:02 nginx: worker process

Root 3189 1 0 2018? 00:00:02 nginx: master process nginx

Root 19020 15396 0 16:45 pts/2 00:00:00 grep-color=auto nginx

one

# pidof-s nginx

3189

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

This is the whole content of what the pidof command is in the Linux system. For more information about what the pidof command in the Linux system is, you can search the previous article or browse the following article to learn! I believe the editor will add more knowledge to you. I hope you can support it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report