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 are the process commands in the linux operating system?

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

Share

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

Editor to share with you what the linux operating system to view the process commands, I believe that most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Linux to view the process of the command are: 1, PS command, the command can see which processes are running and their running status; 2, Top command, the command can display the situation of each thread in real time; 3, Pstree command, the command to show the tree chart of the derivative relationship between processes; 4, Pgrep command and so on.

Linux View process command

1. Linux View process command: PS command

The ps command is a fairly powerful Linux process view command. Using this command, you can determine which processes are running and running state, whether the process ends, whether the process is dead or not, which processes take up too much resources, and so on. In short, most of the information is available by executing the command.

PS command syntax:

Ps [options]

-e displays all processes, environment variables

-f full format

-h does not display the title

-l long format

-w wide output

-a displays all processes on the terminal, including those of other users

-r displays only the running processes

-x shows the progress of the terminal without control.

The PS command uses:

The ps command is used to view currently running processes, the most common method is ps aux, and then use the grep command through the pipeline to filter to find specific processes, and then operate on specific processes, in which grep plays the role of search.

For example:

Ps-ef | grep java

It means to view the process information that CMD is java in all processes.

Ps-aux | grep java

-aux displays all statu

Usually use ps to view the process PID, and use the kill command to terminate the process, such as:

For example: kill-9 [PID]

-9 means forcing the process to stop immediately

2. Linux View process command: Top command

The top command displays the situation of each thread in real time. To turn on thread viewing in the top output, call the "- H" option of the top command, which lists all Linux threads. You can also switch thread viewing mode on or off by pressing the "H" key while top is running.

3. Linux View process command: Pstree command

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

Pstree command syntax:

Pstree (option)

-a display complete command and parameters-c repeat process display-c display process ID, PID-n arrange processes by PID

4. Linux View process command: Pgrep command

The pgrep command looks for a process by name from the running process queue and displays the process id found. Each process ID is represented as a decimal number, separated by a split string from the next ID, and the default split string is a new line. For each attribute option, the user can specify a collection of possible values separated by commas on the command line.

Pgrep command syntax:

Pgrep (option) (parameter)

-l displays the process name and process PID-o process start ID-n process termination ID

The above are all the contents of the process commands in the linux operating system. Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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