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

Use the pgrep command of linux to retrieve the currently running process

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces the use of linux's pgrep command to retrieve the currently running process, the article is very detailed, has a certain reference value, interested friends must read it!

The pgrep command is to retrieve the running process, showing that the matching criterion is the process's PID, which can be matched with a regular expression to match the process or the command line.

When selecting a process owner, the default matching rule is the logical and relationship.

Syntax format: pgrep [parameters] [mode]

Common parameters:

-d sets a string, each process ID-f mode parameter used to separate the output is only used to match the process name-I list the process name and process ID-P only select the process that matches the specified parent process ID-u selection matches only the specified valid user ID process-U selection matches only the process that specifies the real user ID

Reference example

Query the PID of the bash process started by user root:

[root@linuxcool ~] # pgrep-u root bash above is used to retrieve all the contents of the currently running process using the pgrep command of linux. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Servers

Wechat

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

12
Report