ps-ef|grep命令详解(Detailed explanation of PS ef|grep command)

ps 命令的作用是显示进程信息的;

| 符号,是个管道符号,表示ps 和 grep 命令同时执行;

grep 命令是查找(Global Regular Expression Print),能使用正则表达式搜索文本,然后把匹配的行显示出来;

ps命令有一些参数: -e : 显示所有进程 -f : 全格式 -h : 不显示标题 -l : 长格式 -w : 宽输出 a :显示终端上的所有进程,包括其他用户的进程。 r :只显示正在运行的进程。 u :以用户为主的格式来显示程序状况。 x :显示所有程序,不以终端机来区分。

示例:

[root@izbp163wlhi02tcaxyuxb7z wang]# ps -f | grep rabbitmq_server-3.6.1/root      8684  6682  0 16:41 pts/3    00:00:00 grep –color=auto rabbitmq_server-3.6.1/12结果信息从前到后依次是:

UID PID PPID C STIME TTY TIME CMD

zzw 14124 13991 0 00:38 pts/0 00:00:00 grep –color=auto dae——————— 作者:lightClouds917 来源:CSDN 原文:https://blog.csdn.net/weixin_39800144/article/details/80929534 

————————

PS command is used to display process information;

|Symbol, a pipe symbol, indicates that PS and grep commands are executed at the same time;

The grep command is to find (Global regular expression)   Print), which can use regular expressions to search text, and then display the matching lines;

The PS command has some parameters:  – E: display all processes  – F: full format  – H: do not display title  – L: long format  – W: wide output   a: Displays all processes on the terminal, including those of other users.   r: Show only running processes.   u: Display program status in a user dominated format.   x: Display all programs, not distinguished by terminal.

Example:

[root@izbp163wlhi02tcaxyuxb7z wang]# ps -f | grep rabbitmq_server-3.6.1/root      8684  6682  0 16:41 pts/3    00:00:00 grep –color=auto rabbitmq_server-3.6.1/12结果信息从前到后依次是:

UID PID PPID C STIME TTY TIME CMD

zzw 14124 13991 0 00:38 pts/0 00:00:00 grep –color=auto dae———————   Author: lightclouds917   Source: CSDN   Original text: https://blog.csdn.net/weixin_ 39800144/article/details/80929534