Home >Computer Tutorials >Computer Knowledge >Detailed explanation of Linux ps command, Linux process viewing.

Detailed explanation of Linux ps command, Linux process viewing.

王林
王林forward
2024-03-06 15:52:141202browse

Linux ps命令详解,Linux查看进程。

The ps command in Linux system is used to view the currently running processes. The following is a detailed description of the ps command:

  1. Basic syntax:
ps [选项]
  1. Common options:
  • a: Display the processes of all users, including processes of other users.
  • u: Display detailed process information, including the owner of the process.
  • x: Display processes that do not control the terminal.
  • e: Display all processes, including system processes without terminals.
  • f: Display the relationship between processes in a tree format.
  • r: Only display running processes.
  • l: Display process information in long format.
  • p: Specify the process ID to be viewed.
  • aux: Commonly used combination options, display detailed process information of all users.
  1. Example usage:
  • View all processes:
ps aux
  • View the process information of the specified process ID:
ps -p 1234
  • Display the relationships between processes in tree format:
ps f
  • Only display running processes:
ps r
  1. Column meanings output by ps command:
  • USER: The owner of the process.
  • PID: Process ID.
  • %CPU: The percentage of CPU used by the process.
  • %MEM: The percentage of memory used by the process.
  • VSZ: The virtual memory size of the process.
  • RSS: The physical memory size of the process.
  • TTY: The terminal to which the process is connected.
  • START: The start time of the process.
  • COMMAND: The command line of the process.
  1. Further filter and find processes:
  • Use the pipe symbol and grep command to filter and find specific processes. For example, to find a process named "apache":
ps aux | grep apache

By using the ps command, you can view the currently running processes and get detailed information about the processes. Depending on your needs, different options are available to meet specific process viewing and filtering requirements.

The above is the detailed content of Detailed explanation of Linux ps command, Linux process viewing.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete