Ps commands in Linux

Source: Internet
Author: User
Linux ps command details Linux processes have five statuses: 1. running (running or waiting in the running queue) 2. interruption (sleep, blocked, waiting for the formation of a condition or receiving a signal) 3. non-disruptive (do not wake up when receiving the signal or do not run, the process must wait until there is an interruption... linux ps command details Linux processes have five states:
1. running (running or waiting in the running queue) 2. interruption (sleep, blocked, waiting for the formation of a condition or receiving a signal) 3. do not interrupt (do not wake up when receiving the signal or do not run, the process must wait until an interruption occurs) 4. dead (the process has been terminated, but the process descriptor exists until the parent process calls wait4 () released after the system call) 5. stop (the process stops running after receiving signals from SIGSTOP, SIGSTP, SIGTIN, and SIGTOU)
Five status codes used by the PS tool to identify a process:
D. uninterruptible sleep (usually IO) R run runnable (on run queue) S interrupt sleepingT stop traced or stoppedZ dead a defunct ("zombie") process name: ps usage permission: usage of all users: ps [options] [-- help] description: displays the dynamic process
Parameters: www.2cto.com have many ps parameters, only A few common parameters are listed here and their meanings are briefly described.-A lists all the Itineraries.-w: show widening. More information is displayed.-au: show more details.-aux: show all other parameters. user's itinerary au (x) output Format: user pid % CPU % mem vsz rss tty stat start time commanduser: Travel owner PID: pid % CPU: occupied CPU usage % MEM: occupied memory usage VSZ: occupied virtual memory size RSS: occupied memory size TTY: terminal secondary device number (minor device number of tty)
STAT: the status of the trip: D: non-interrupted static R: in progress S: static T: paused Z: No, but cannot be eliminated for the moment W: there is not enough memory paging to allocate <: high-priority stroke N: low-priority stroke L: memory is allocated by Page and locked in memory (instant system or memory a I/O)
START: trip start time: execution time command: executed COMMAND example: www.2cto.com psPID tty time limit 2791 ttyp0 00:00:00 tcsh3092 ttyp0 00:00:00 ps % ps-apid tty time CMD1? 00:00:03 init2? 00:00:00 kflushd3? 00:00:00 kpiod4? 00:00:00 kswapd5? 00:00:00 mdrecoveryd... % ps-auxUSER PID % CPU % mem vsz rss tty stat start time COMMANDroot 1 0.0 0.7 1096 472? S Sep10 init [3] root 2 0.0 0.0 0 0? SW Sep10 [kflushd] root 3 0.0 0.0 0 0? SW Sep10 [kpiod] root 4 0.0 0.0 0 0? SW Sep10 0: 00 [kswapd]
The specific commands are described as follows:
1) ps a shows all programs under the current terminal, including those of other users. 2) ps-A shows all programs. 3) when listing programs in ps c, the real command name of each program is displayed without the path, parameter or resident service identifier. 4) the effect of this parameter is the same as that of the specified "A" parameter. 5) when listing programs, ps e displays the environment variables used by each program. 6) ps f uses ASCII characters to display the tree structure and express the relationship between programs. 7) the ps-H tree structure is displayed, indicating the relationship between programs. 8) ps-N shows all programs, except the programs under the ps command terminal. 9) ps displays the program status in the program signal format. 10) when listing programs in ps, it includes interrupted subroutines. 11) ps-t <终端机编号> Www.2cto.com
Specify the terminal number and list the status of the program that belongs to the terminal. 12) ps u displays the program status in user-based format. 13) ps x shows all programs, which are not distinguished by terminals. The most common method is ps-aux. then, a pipeline symbol is used to direct to grep to find a specific process and then operate on the specific process. This article is from the fat shark network.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.