Ps

来自姬鸿昌的知识库
跳到导航 跳到搜索

-e     Select all processes.


-f     Do full-format listing.

This option can be combined with many other UNIX-style options to add additional columns. 

It also causes the command arguments to be printed. 

When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. 

See the c option, the format keyword args, and the format keyword comm.

[root@iZ8vbcjkeqbrdmmbt23vboZ ~]# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Jul26 ?        00:04:00 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root     10255     1  0 Aug11 ?        00:00:06 /usr/bin/containerd-shim-runc-v2 -namespace moby -id fca2c79917cfc8c93dd3ee1d8e0809dac7e7a3309d51b2b9d53262a1ca976631 -address /run/containerd/containerd.sock
polkitd  10273 10255  0 Aug11 ?        00:03:42 mysqld
root     10384 10087  0 Aug11 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.17.0.3 -container-port 443
root     10395 10087  0 Aug11 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.17.0.3 -container-port 80


指定进程 ID ,查看单个进程的启动命令

[root@bogon bin]# netstat -apn|grep 9092
tcp6       0      0 192.168.137.200:9092    :::*                    LISTEN      24310/java          
tcp6       0      0 192.168.137.200:60042   192.168.137.200:9092    ESTABLISHED 24310/java          
tcp6       0      0 192.168.137.200:9092    192.168.137.200:60042   ESTABLISHED 24310/java
[root@bogon bin]# ps p 24310
  PID TTY      STAT   TIME COMMAND
24310 pts/0    Sl     0:05 /root/jdk1.8.0_301/bin/java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Xloggc:/usr/local/kafka/k
[root@bogon bin]#