广告位联系
返回顶部
分享到

进程状态ps -ef中的e、f含义讲解

linux shell 来源:互联网 作者:佚名 发布时间:2022-11-09 11:08:07 人浏览
摘要

linux或mac控制台下输入ps -ef | grep 关键字可以查看是否有相应的进程启动信息中包含关键字。如: ps的意思是process status,即进程状态。在控制台执行man ps命令可以查看ps命令后面的命令

linux或mac控制台下输入ps -ef | grep 关键字可以查看是否有相应的进程启动信息中包含关键字。如:

ps的意思是process status,即进程状态。在控制台执行man ps命令可以查看ps命令后面的命令选项的含义如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

The options are as follows:

 

-A      Display information about other users' processes, including those without controlling ter-

        minals.

 

-a      Display information about other users' processes as well as your own.  This will skip any

        processes which do not have a controlling terminal, unless the -x option is also specified.

 

-C      Change the way the CPU percentage is calculated by using a ``raw'' CPU calculation that

        ignores ``resident'' time (this normally has no effect).

 

-c      Change the ``command'' column output to just contain the executable name, rather than the

        full command line.

 

-d      Like -A, but excludes session leaders.

 

-E      Display the environment as well.  This does not reflect changes in the environment after

        process launch.

 

-e      Identical to -A.

 

-f      Display the uid, pid, parent pid, recent CPU usage, process start time, controlling tty,

        elapsed CPU usage, and the associated command.  If the -u option is also used, display the

        user name rather then the numeric uid.  When -o or -O is used to add to the display follow-

        ing -f, the command field is not truncated as severely as it is in other formats.

 

-G      Display information about processes which are running with the specified real group IDs.

 

-g      Display information about processes with the specified process group leaders.

 

-h      Repeat the information header as often as necessary to guarantee one header per page of

        information.

 

-j      Print information associated with the following keywords: user, pid, ppid, pgid, sess,

        jobc, state, tt, time, and command.

 

-L      List the set of keywords available for the -O and -o options.

 

-l      Display information associated with the following keywords: uid, pid, ppid, flags, cpu,

        pri, nice, vsz=SZ, rss, wchan, state=S, paddr=ADDR, tty, time, and command=CMD.

 

-M      Print the threads corresponding to each task.

 

-m      Sort by memory usage, instead of the combination of controlling terminal and process ID.

 

-O      Add the information associated with the space or comma separated list of keywords speci-

        fied, after the process ID, in the default information display.  Keywords may be appended

        with an equals (`=') sign and a string.  This causes the printed header to use the speci-

        fied string instead of the standard header.

 

-o      Display information associated with the space or comma separated list of keywords speci-

        fied.  Multiple keywords may also be given in the form of more than one -o option.  Key-

        words may be appended with an equals (`=') sign and a string.  This causes the printed

        header to use the specified string instead of the standard header.  If all keywords have

        empty header texts, no header line is written.

 

-p      Display information about processes which match the specified process IDs.

 

-r      Sort by current CPU usage, instead of the combination of controlling terminal and process

        ID.

 

-S      Change the way the process time is calculated by summing all exited children to their par-

        ent process.

 

-T      Display information about processes attached to the device associated with the standard

        input.

 

-t      Display information about processes attached to the specified terminal devices.

 

-U      Display the processes belonging to the specified real user IDs.

 

-u      Display the processes belonging to the specified usernames.

 

-v      Display information associated with the following keywords: pid, state, time, sl, re,

        pagein, vsz, rss, lim, tsiz, %cpu, %mem, and command.  The -v option implies the -m option.

 

-w      Use 132 columns to display information, instead of the default which is your window size.

        If the -w option is specified more than once, ps will use as many columns as necessary

        without regard for your window size.  When output is not to a terminal, an unlimited number

        of columns are always used.

 

-X      When displaying processes matched by other options, skip any processes which do not have a

        controlling terminal.

 

-x      When displaying processes matched by other options, include processes which do not have a

        controlling terminal.  This is the opposite of the -X option.  If both -X and -x are speci-

        fied in the same command, then ps will use the one which was specified last.

可见
-e和-A的意思是一样的,即显示有关其他用户进程的信息,包括那些没有控制终端的进程。
-f显示用户id,进程id,父进程id,最近CPU使用情况,进程开始时间等等。

ps -ef命令含义

工作中,平时都是通过ps -ef 去进行查看系统上的运行的所有进程,是一个特别常用的命令;这里说下该命令的具体含义:

只执行ps命令,默认是显示当前控制台下属于当前用户的进程;

参数 -e  显示运行在系统上的所有进程

参数 -f  扩展显示输出

UID      启动进程的用户

PID      进程的进程号

PPID    父进程进程号

C          cpu使用率

STIME   进程启动时的系统时间

TTY       进程启动时终端设备

TIME     运行进程需要的累积CPU时间

CMD   启动程序名称或命令

更多的ps命令可以通过 man ps 或者  ps --help all 来获取


版权声明 : 本文内容来源于互联网或用户自行发布贡献,该文观点仅代表原作者本人。本站仅提供信息存储空间服务和不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权, 违法违规的内容, 请发送邮件至2530232025#qq.cn(#换@)举报,一经查实,本站将立刻删除。

您可能感兴趣的文章 :

原文链接 : https://manongwushuang.blog.csdn.net/article/details/83537275
    Tag :
相关文章
  • linux命令中的大于号、小于号的作用及代表的意思

    linux命令中的大于号、小于号的作用及代表的意思
    在linux中,大家也许会经常看到 、 、 、、这几个小于号、大于号,那么他们分别代表什么意思呢? 好的我们来实验下先,先创建个 test.t
  • 进程状态ps -ef中的e、f含义讲解

    进程状态ps -ef中的e、f含义讲解
    linux或mac控制台下输入ps -ef | grep 关键字可以查看是否有相应的进程启动信息中包含关键字。如: ps的意思是process status,即进程状态。在控
  • Linux中的grep -v、-e、-E用法小结
    grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜
  • Linux实现彻底清理空文件夹的方法

    Linux实现彻底清理空文件夹的方法
    最近工作中遇到一个需求删除指定路径下的所有空文件夹。这里的空文件夹的认定标准是:如果某个文件夹的子文件夹全是空文件夹,也认
  • shell脚本实现字符串的动态替换方法

    shell脚本实现字符串的动态替换方法
    我们有时候需要完成字符串的多组替换,比如需要完成以下替换 将小草替换为真是让人印象深刻 将小狗的替换为可爱的 将你听清楚了吗替
  • shell循环命令的介绍
    1. for 命令 1.1 for 命令的使用 bash shell 提供了for命令,可以创建一个遍历一系列值的循环。每次一轮循环都使用其中一个值来执行已定义好的
  • shell脚本设置日志格式的方法
    shell脚本设置日志格式 1.封装函数 #!/bin/bash function log() { echo $@ } //测试: log this is a test... log today is `date +%Y-%m-%d` 2.设置时间日志 #!/bin/bash
  • linux下shell脚本备份文件的方法实现
    1、shell自动备份 主要功能: 1)将pathSrc目录中的文件拷贝到pathDst目录中去。 具体步骤:先查询源目录和目标目录中的文件,分别存在file
  • shell脚本实现定时删除文件或文件夹
    一、删除XX天(默认10天)之前某个目录下面带.log的日志文件,并且输出文件显示删除的文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  • shell脚本批量将文件复制到指定的文件夹下

    shell脚本批量将文件复制到指定的文件夹下
    由于线上文件比较多,选择特定的文件拿下线下进行语料标注,如果指定的文件数量太多,一个个复制就很麻烦。所以写一个shell脚本进行批
  • 本站所有内容来源于互联网或用户自行发布,本站仅提供信息存储空间服务,不拥有版权,不承担法律责任。如有侵犯您的权益,请您联系站长处理!
  • Copyright © 2017-2022 F11.CN All Rights Reserved. F11站长开发者网 版权所有 | 苏ICP备2022031554号-1 | 51LA统计