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 use of Linux's pstree command

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

Share

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

This article mainly explains "what is the use of Linux's pstree command". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the use of Linux's pstree command"?

Linux commonly used command pstree command shows the derived relationship between processes in the way of tree diagram, and the display effect is more intuitive.

Pstree shows the derivative relationship between processes in the way of tree diagram.

Syntax pstree (option) option-a: displays the complete instruction for each program, including the path, parameter, or resident service tag;-c: does not use reduced notation;-G: uses the column drawing character of the VT100 terminal;-h: when listing the tree diagram, it specifically indicates the program currently executed;-H: the effect of this parameter is similar to that of the specified "- h" parameter, but specifically indicates the specified program. -l: display the tree view in long column format;-n: sort by program identification code. The default is to sort by program name;-p: display the program identification number;-u: display the user name;-U: use the UTF-8 column to draw characters;-V: display version information. The instance displays the process number and process id of all current processes

Pstree-p displays all the details of all processes. If you encounter the same process name, you can compress it.

Pstree-a gets the PID of the SSH session

Pstree-p | grep ssh # |-sshd (1221)-+-sshd (2768)-bash (2770)-+-grep (2810) # | `- sshd (2807)-- sshd (2808) from the output above, you can see the tree diagram of sshd processes and branches. The main process of sshd is sshd (1221), and the other two branches are sshd (2768) and sshd (2807).

At this point, I believe you have a deeper understanding of "what is the use of Linux's pstree command?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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