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 ways to view processes under Linux

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

Share

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

This article will explain in detail what are the methods of viewing the process under Linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Process is a running activity of a program in a computer on a certain data set, the basic unit of resource allocation and scheduling of the system, and the basis of the structure of the operating system.

The first kind:

The ps auxps command is used to report the process status of the current system. You can interrupt and delete unnecessary programs at any time with kill instructions. Ps command is the most basic but also very powerful process view command, which can be used to determine which processes are running and running status, whether the process ends, whether the process is dead, which processes take up too much resources, and so on. In short, most of the information can be obtained by executing the command.

A: displays all the process information under the current terminal, including the processes of other users.

U: use a user-based format to output process information.

X: displays the progress of the current user under all terminals.

Example:

The fields in the figure above explain:

USER: the name of the user account that started the process PID: the ID number of the process, which is the only% CPU:CPU percentage in the current system% MEM:% memory footprint

VSZ: size of virtual memory (swap space) RSS: size of resident memory (physical memory)

TTY: on which terminal the process runs. "?" Table unknown or does not require terminal STAT: shows the current state of the process, such as S (hibernating), R (running), Z (dead),

START: the time when the process was started TIME: the process took up CPU time COMMAND: the name of the command that started the process

Summary: ps aux displays process information in the form of a simple list.

The second kind:

Ps-elf-e: displays all process information in the system.

-l: displays process information in long format.

-f: displays process information in full (full) format.

The above field explains that PPID is the PID of the parent process, mostly just like the first one.

The third kind:

Top displays the ranking of processes with a full-screen interactive interface, and timely tracks the consumption of system resources, including CPU, memory, and so on. By default, it is refreshed every three seconds, which is basically similar to the task manager in the Windows system.

The above figure explains: Tasks (system tasks) information: total, total number of processes; running, number of running processes; sleeping, number of dormant processes; stopped, number of aborted processes; zombie, number of dead and unresponsive processes.

CPU information: us, user occupancy; sy, kernel occupancy; ni, priority scheduling occupancy; id, idle CPU;wa,I/O waiting occupancy; hi, hardware interrupt occupancy; si, software interrupt occupancy; st, virtualization occupancy. To know the percentage of CPU that is free, mainly look at the% id section.

Mem (memory) information: total, total memory space; used, used memory; free, free memory; buffers, cache area.

Swap (swap space) information: total, total swap space; used, used swap space; free, free swap space; cached, cache space.

The fourth kind:

Pstree-aup can be used with | grep to query specific processes. For example, pstree-aup | grep php

The derivative relationship between processes is shown in the way of tree diagram, and the display effect is more intuitive. -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 characters of the VT100 terminal;-h: when listing the tree diagram, specifically indicates the currently executed program;-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 program identification code;-u: display user name

This is the end of this article on "what are the ways to view processes under Linux?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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