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

Detailed explanation of Linux ps command, Linux process viewing.

王林
Release: 2024-03-06 15:52:14
forward
1206 people have browsed it

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 [选项]
Copy after login
  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
Copy after login
  • View the process information of the specified process ID:
ps -p 1234
Copy after login
  • Display the relationships between processes in tree format:
ps f
Copy after login
  • Only display running processes:
ps r
Copy after login
  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
Copy after login

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!

Related labels:
source:mryunwei.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template