服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Linux - 进程状态ps -ef中的e、f含义讲解

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

2023-03-06 13:42pilaf1990 Linux

这篇文章主要介绍了进程状态ps -ef中的e、f含义讲解,通过本文学习我们知道-e和-A都显示有关其他用户进程的信息,包括那些没有控制终端的进程,-f显示用户id,进程id,父进程id,最近CPU使用情况,进程开始时间等等,具体含义及

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

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

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命令,默认是显示当前控制台下属于当前用户的进程;

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

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

参数 -f  扩展显示输出

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

UID      启动进程的用户

PID      进程的进程号

PPID    父进程进程号

C          cpu使用率

STIME   进程启动时的系统时间

TTY       进程启动时终端设备

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

CMD   启动程序名称或命令

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

到此这篇关于进程状态ps -ef中的e、f含义讲解的文章就介绍到这了,更多相关ps -ef中e、f含义内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文链接:https://manongwushuang.blog.csdn.net/article/details/83537275

延伸 · 阅读

精彩推荐
  • LinuxLinux下修复inittab文件丢失的两种方法

    Linux下修复inittab文件丢失的两种方法

    linux系统图下inittab文件丢失了该怎么办?/etc/inittab文件是linux系统初始化配置文件,该文件出现错误或者丢失时,可能导致无法启动系统,下面分享两种解决...

    脚本之家6642019-10-12
  • LinuxLinux桌面的4种扫描工具

    Linux桌面的4种扫描工具

    今天小编就为大家分享一篇关于Linux桌面的4种扫描工具的文章,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编...

    ScottNesbitt6892022-07-27
  • Linuxlinux下的守护进程

    linux下的守护进程

    守护进程(Daemon)是运行在后台的一种特殊进程。它独立于控制终端并且周期性地执行某种任务或等待处理某些发生的事件。守护进程是一种很有用的进程...

    Linux教程网7312021-10-21
  • LinuxVim 强制保存只读类型文件的方法

    Vim 强制保存只读类型文件的方法

    你是否会和我一样经常碰到这样的情景:在VIM中编辑了一个系统配置文件,当需要保存时才发现当前的用户对该文件没有写入的权限。这个时候就需要强制...

    旷世的忧伤6032021-12-20
  • LinuxLinux实现文件内容去重及求交并差集

    Linux实现文件内容去重及求交并差集

    这篇文章主要介绍了Linux实现文件内容去重及求交并差集,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可...

    楔子4742020-08-04
  • Linux如何使用Shell写一个显示目录结构的命令?

    如何使用Shell写一个显示目录结构的命令?

    在Linux中使用Shell写一个显示目录结构的命令,快速寻找目录结构。...

    运维派4232020-11-03
  • LinuxLINUX的磁盘管理du命令详解

    LINUX的磁盘管理du命令详解

    du(disk usage)命令可以计算文件或目录所占的磁盘空间。没有指定任何选项时,它会测量当前工作目录与其所有子目录,分别显示各个目录所占的快数,最后...

    linux命令大全2992020-03-20
  • Linux详解linux中nano命令

    详解linux中nano命令

    这篇文章主要介绍了详解linux中nano命令,详细的介绍了nano命令的用法,非常具有实用价值,需要的朋友可以参考下...

    linuxde5652022-02-17