PS Viewing process

Source: Internet
Author: User

As a system administrator, be sure to know that the systems you are managing are running, and that you can view them as soon as you open the Task Manager under Windows. Under Linux? In fact, the top command described above can be, but not easy to see, of course, there are also special commands to display the system process:

[[Email protected] ~]# ps auxuser       pid %cpu  %mem    vsz   rss tty      stat  start   time commandroot         1   0.0  0.2   2900   852 ?         Ss   11:49   0:01 /sbin/initroot          2  0.0  0.0      0      0 ?        S    11:49    0:00 [kthreadd]root         3  0.0   0.0      0     0 ?        &nbSp s    11:49   0:00 [migration/0]root          4  0.0  0.0      0      0 ?        S    11:49    0:11 [ksoftirqd/0]root         5  0.0   0.0      0     0 ?         S    11:49   0:00 [migration/0]root          6  0.0  0.0       0     0 ?        S     11:49   0:00 [watchdog/0]root          7  0.0  0.0      0     0 ?         S    11:49   0:04 [events/0]root          8  0.0  0.0      0      0 ?        S     11:49   0:00 [cgroup]root         9   0.0  0.0      0     0 ?         s    11:49   0:00 [ Khelper]

Amin also often see some people like to use   ps   -elf   very similar, The information shown is basically the same. PS command more usage, Amin no longer do the introduction, because you can only use this command is enough, please man a bit. The meanings of several parameters are described below.

pid: The ID of the process, this ID is very useful, in Linux kernel management process relies on PID to identify and manage a certain process, such as I want to terminate a course, then use      The PID of the process   Sometimes does not kill, you need to add a-9 option  -9    process pid

STAT: Indicates the status of the process, and the process state is divided into the following types (not required to remember, but to understand)

D a process that cannot be interrupted (usually IO)

R Running Process

The process that S has been interrupted, typically, most of the processes in the system are in this state

T has stopped or paused the process, if we are running a command, say sleep 10 if we click Ctrl-z let him pause, then we use PS View will show the status of T

W This seems to say that after the kernel 2.6xx, it is expressed as insufficient memory page allocation

X already dead process (this never seems to happen)

Z zombie process, can't kill, fight the garbage process, the system a small resource, but no relationship. If too many, there is a problem. Generally does not appear.

< high-priority processes

N Low-priority processes

L was locked in memory paging

S master Process

L Multithreading Process

+Represents a process running in the foreground

This PS command is one of Amin's many commands in the work, so please remember it. With regard to the use of PS commands, Amin is often used together with pipe breaks to see a process or its number.

[[email protected] ~]# ps aux |grep -c mingetty6[[email protected]  ~]# ps aux |grep  mingettyroot       952   0.0  0.1   2008   440 tty2      Ss+  11:49   0:00  /sbin/mingetty /dev/tty2root        954  0.0  0.1   2008   440  tty3     ss+  11:49   0:00  /sbin/mingetty  /dev/tty3root       956  0.0  0.1    2008   440 tty4     Ss+  11:49    0:00  /sbin/mingetty /dev/tty4root       958  0.0   0.1   2008   436 tty5     ss+  11:49   0:00   /sbin/mingetty /dev/tty5root       960  0.0   0.1   2008   444 tty6     Ss+   11:49   0:00  /sbin/mingetty /dev/tty6root       8440  0.0  0.2   5984   732 pts/3     s+   17:12   0:00  grep mingetty

The above 6 is wrong and needs to lose 1 because the grep command itself counts as one when using the grep command.


This article is from "Linux rookie" blog, please be sure to keep this source http://490617581.blog.51cto.com/11186315/1757821

PS Viewing process

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.