Linux PS and JPS commands

ps

(English full spelling: process status) command is used to display the status of the current process, similar to the task manager of windows.

grammar:

ps [options] [--help]

There are many parameters of ps, some commonly used ones are listed below

-A list all processes
-w display widening can display more information
-au display more detailed information
-aux display all processes including other users

The output format of au(x) is as follows:

 The meaning of each attribute:

USER: process owner
PID: pid
%CPU: occupied CPU usage
%MEM: occupied memory usage
VSZ: occupied virtual memory size
RSS: occupied memory size
TTY: terminal minor device number (minor device number of tty)
STAT: The status of the trip:
    D: Uninterruptible dormant state (usually IO process)
    R: Executing
    S: Static state
    T: Suspended execution
    Z: Does not exist but cannot be eliminated temporarily
    W: Not enough
    <: high-priority process
    N: low-priority process L: memory
    page allocated and locked in memory (real-time system or AI/O)
START: process start time
TIME: executed Time
COMMAND: the command executed

Use ps to query the specified process:

ps -ef | grep redis

On the basis of the fixed keyword query, it can be queried again

ps -ef | grep redis | grep redis.conf

jps

(English full spelling: JavaVirtual Machine Process Status Tool) It is a small tool provided by jdk to view the current java process. It is used to view the specific status of all Java processes with access rights in the JVM based on HotSpot, including the process ID. The path and startup parameters of the process are similar to ps on unix, except that jps is used to display the java process, and jps can be understood as a subset of ps.

grammar

jps [options] [hostid]  

 jps common parameters (options)

-q : Only output the VM identifier, excluding class
-m Output the parameters passed to the main method, if it is an embedded JVM, the output is null.
-l: output the complete package name, application main class name, full path name of the jar
-v: output jvm parameters
-V: output the parameters passed to the JVM through the flag file (.hotspotrc file or -XX:Flags=specified document)

When using jps, if the hostid is not specified, it will only display all the Java processes in the local environment; if the hostid is specified, it will display the java processes on the specified hostid, but this requires the jstatd service to be enabled on the remote service.

Supongo que te gusta

Origin blog.csdn.net/weixin_42218169/article/details/129988958
Recomendado
Clasificación