How to view the process of the Linux server

  

After the Linux server starts normally, the program is called when the service is provided, which occupies the process. At this time, how to check which processes in the system are being called? We can view it by the following command.

1.ps

The ps command is the most basic and very powerful process view command. Use this command to determine which processes are running and the state it is running, whether the process ends, whether the process is dead, which processes are taking up too many resources, and so on. In short, most of the information can be obtained by executing this command. The ps command is most commonly used to monitor the background process, because the background process does not communicate with standard input/output devices such as screens and keyboards. Therefore, if you need to detect background conditions, you need to use the ps command. Its format is as follows:

Format: ps [options] The main options are as follows.

-a: Displays information about all processes in the system.

-e: Display information about all processes.

-f: Display all information about the process.

-l: Display process information in long format.

-r: Show only running processes.

-u: Display user-oriented format (including information such as user name, CPU, and memory usage).

-x: Display process information on all non-control terminals.

-p: Displays the process information specified by the process ID.

-t: Display the process information on the specified terminal.

To monitor and control the process, you must first understand the current process, of course, you need to blow the nose and lick the Mü 龊s command to view the process, according to the information displayed You can see which process is running, which process is suspended, how long the process has been running, the resources the process is using, the relative priority of the process, and the process's sign number (PID). All of this information is useful to users and is especially important for system administrators. Use the ps -aux command to get all the information about all the processes on the terminal. This is one of the most commonly used commands, as shown below:

[root@localhost ~]# ps axu USER PID %CPU %MEMVSZ RSS TTYSTAT START TIME COMMAND root 10.00.010348 688 ?SsMar160:01 init [5] root 20.00.000 ?S<Mar160:00 [migration/0] root 30.00.000 ?SNMar160:00 [ksoftirqd /0] root 40.00.000 ?S<Mar160:00 [watchdog/0] root 50.00.000 ?S<Mar160:00 [migration/1] root 60.00.000 ?SNMar160:00 [ksoftirqd/1] ... avahi31530.00.023148336 ?SsMar160:00 avahi-daemon: chroot helper root32140.00.018416476 ?SMar160:00 /usr/sbin/smartd -q never root32190.00.03792488 tty1Ss+Mar160:00 /sbin/mingetty tty1 root32200.00.03792484 tty2Ss+ Mar160:00 /sbin/mingetty tty2 root32210.00.03792488 tty3Ss+Mar160:00 /sbin/mingetty tty3 root32220.00.03792488 tty4Ss+Mar160:00 /sbin/mingetty tty4 root32240.00.03792488 tty 5Ss+Mar160:00 /sbin/mingetty tty5 root32260.00.03792488 tty6Ss+Mar160:00 /sbin/mingetty tty6 root32330.00.01699122756 ?SsMar160:00 /usr/sbin/gdm-binary -nodaemon root33220.00.01971242564 ?SMar160:00 /usr/Sbin/gdm-binary -nodaemon root33240.00.11898084112 ?SlMar160:00 /usr/libexec/gdm-rh-security-token-helper root33250.00.1905486264 tty7Ss+Mar160:02 /usr/bin/Xorg :0 -br -audit 0 - Auth /var/gdm/:0.Xauth -oli root33390.00.425792016784 ?SNMar160:20 /usr/bin/python -tt /usr/sbin/yum-updatesd root33410.00.0129161188 ?SNMar160:00 /usr/libexec/gam_server gdm33510. 00.837961236176 ?SsMar160:00 /usr/libexec/gdmgreeter root43420.00.041096896 ?SsMar160:00 nginx: master process /usr/local/webserver/nginx/sbin/nginx www43430.00.66592026232 ?SMar160:05 nginx: worker process www43440.00.66592026160 ?SMar160 :02 nginx: worker process www43450.00.66607626460 ?SMar160:03 nginx: worker process www43460.00.66592026104 ?SMar160:03 nginx: worker process w Ww43470.00.66605226228 ?SMar160:04 nginx: worker process www43480.00.66601226372 ?SMar160:04 nginx: worker process www43490.00.66578826076 ?SMar160:03 nginx: worker process www43500.00.66592026188 ?SMar160:06 nginx: worker process root53140.00.000 ?SMar280: 00 [pdflush] root53150.00.000 ?SMar280:00 [pdflush] root67670.00.0682841564 tty8Ss+Mar170:00 /bin/bash root103690.00.065556932 pts/2R+14:230:00 ps -axu root189060.06.41443024261272 ?Sl00:150:46 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/us root205730.00.0901403344 ?Ss09:020:00 sshd: root@pts/2 root205750.00.0684121756 pts/2Ss09:020:00 - Bash

Copyright © Windows knowledge All Rights Reserved