How to Find Most Running Processes by Memory and CPU Usage in Linux

Embedded yue xiang park 2022-09-23 09:32:38 阅读数:718



大多数 Linux Users use the pre-installed default system monitoring tool to check memory、CPU 使用率和 CPU 温度.在 Linux 中,Many applications run in the background of the system as daemons,to keep another main tool active or active,This consumes more system resources.

在 Linux 中,You can use various gadgets or terminal commands,It is also possible to use one command to sum by memory CPU Utilization shows all running processes.检查 RAM 和 CPU 负载后,You can determine which app to kill.

by memory and CPU Usage running process

Although there are many system monitoring tools out there,But a simple command can show what is currently on the system CPU 和内存使用情况,从而节省您的时间和精力.Easy to use commands、轻巧,And doesn't take up too much system resources to show what's going on CPU 和内存负载.在这篇文章中,We will see using these commands by memory sum CPU Utilization shows running processesps命令.

在 Linux 中,ps 代表进程状态.它在 Linux 和类 Unix 操作系统上运行,以使用 PID 准备 CPU 和内存使用情况.而且.It allows you to display top applications consuming system resources at a higher rate.

Overall system reporting via command

psThe command generates with PID、时间戳和TTY的报告;Record which application runs for how many minutes,当前状态是什么,and as reported by running processes CPU 和内存使用情况.以下psCommands will be by memory sum CPU Usage prints the overall status of running processes.

$ ps aux

You can also run a short function to see what a specific package is CPU 和内存使用情况.

$ ps aux --sort <column_name>

以下带有-A标志的 ps The command will print the process on the terminal screen ID、时间戳和 TTY.

ps -A

by memory and CPU Usage View running processes

到目前为止,我们已经了解了ps命令是什么、它是如何工作的,以及如何通过 Linux 上的 ps command to view the overall status.We will now examine the processes running on the machine CPU 和内存使用情况.Please do the following given below ps 命令以查看 Linux The memory or of a running process on the machine RAM 使用情况.

$ ps aux --sort -%mem

类似地,You can also pass the given below ps 命令获取 Linux 系统上 CPU statistics and usage summaries.正如您所看到的,-sort 语法在 CPU and memory commands are used,It actually filters out on the machine CPU 和内存使用情况的数据.


$ ps aux --sort -%cpu

Statistics by user

If your system has multiple users,You can filter by user ps 输出数据.The following commands will help you understand how many resources each user is using.

ps -u user

If you want to get the report by running a system thread,Please do the following given below ps 命令.

ps -L 4264 by there

The following commands will be the most useful commands you will need to run from time to time.To see the highest memory usage and CPU the top ten processes,请在终端 shell 上执行以下 ps 命令.

$ ps aux --sort -%mem | head -10
$ ps aux --sort -%cpu | head -10

Default system monitoring tool

到目前为止,We've gone through some of the most commonly used ones ps 命令来查看 Linux memory on the system and CPU Processes running under usage.If you need more syntax or help,Please go through the terminal shell 查看 ps Manual and Help section.

$ man ps
$ ps --help

但是,You can also try using the default system monitoring tool to check file system usage、内存使用情况和 CPU 使用情况.
每个 Linux 发行版都提供了一个 GUI Tools to monitor system resources.Please open the application from your package list and check the GUI based system usage.


由于psis a preinstalled tool,So we don't need it in ours Linux Do any additional installations on the machine.It extracts data from the core kernel and hardware level,So we won't get any misleading output.在整篇文章中,我已经描述了 ps Commands go through memory and CPU Usage to monitor running processes.

版权声明:本文为[Embedded yue xiang park]所创,转载请带上原文链接,感谢。