Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use the ps command in Linux

Shulou Source: shulou.com Published: 2022-05-31 14:29:16 09月30日 Update

This article mainly introduces how to use the ps command in Linux. It is very detailed and has a certain reference value. Friends who are interested must finish it!

(cpu) usage, observe the process information:

Ps auxw | sort-K3-rn | head-20

There are five states of a process on linux:

Run (running or waiting in the run queue)

Interrupt (while dormant, blocked, waiting for the formation of a condition or receiving a signal)

Uninterruptible (unawakened and unrunnable upon receipt of the signal, the process must wait until an interruption occurs)

Deadlock (the process is terminated, but the process descriptor exists until the parent process calls the wait4 () system call to release)

Stop (the process stops running after receiving SIGSTOP, SIGSTP, SIGTIN, SIGTOU signals)

The ps tool identifies five status codes of the process:

D non-interruptible uninterruptible sleep (usually IO)

R runs runnable (on run queue)

S interrupt sleeping

T stop traced or stopped

Z zombie a defunct ("zombie") process

Name: ps

Permissions: all users

Usage: ps [options] [--help]

Description: displays the dynamics of instantaneous travel (process)

Parameters:

There are so many parameters in ps. Only a few commonly used parameters are listed here and their meanings are briefly introduced.

-A list all itineraries

-w display widening can display more information

-au displays more detailed information

-aux displays all itineraries that include other users

Au (x) output format:

USER PID CPU MEM VSZ RSS TTY STAT START TIME COMMAND

USER: process owner

PID: pid

% CPU: occupied CPU utilization

% MEM: memory usage occupied

VSZ: size of virtual memory occupied

RSS: the amount of memory occupied

TTY: secondary device number of the terminal (minor device number of tty)

STAT: the status of the trip:

D: uninterruptible stillness

R: in progress

S: static state

T: suspend execution

Z: does not exist but cannot be eliminated for the time being

W: there are not enough memory pages to allocate

Tags: Process program command user parameter memory time run terminal status system priority terminal itinerary memory memory name size identification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux Shulou Technology Docker Microsoft