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

You can see what the process's Linux command refers to.

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

You can see what the Linux command of the process refers to. I believe many inexperienced people don't know what to do about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

In the process of using the Linux system, we sometimes need to check the background processes and selectively close some unused processes, so what are the commands to view the processes in Linux? Today we are going to summarize and sort out some commonly used Linux view process commands.

What are the commands for Linux to view processes?

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

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.

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

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

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

After reading the above, have you mastered the way to see what the Linux command of the process refers to? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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