AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-596859

lightxy233's questions

Martin Hope
lightxy233
Asked: 2023-12-21 15:28:30 +0800 CST

`ps axjf` 和 `ps -axjf` 之间的区别

  • 6

我正在尝试更深入地了解psLinux中的命令。

当我使用时我很困惑ps axjf,ps -axjf当我发现它们在手册中似乎有不同的含义但它们的输出几乎相同时。

它们之间的具体区别是什么?

对于这些选项,手册说:

a      Lift the BSD-style "only yourself" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like.  The set of processes selected in this manner is in addition to the set of processes selected by other means.  An alternate description is that this option causes ps to list all processes with a terminal (tty), or to list all processes when used together with the x option.

-a     Select all processes except both session leaders (see getsid(2)) and processes not associated with a terminal.

x      Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like.  The set of processes selected in this manner is in addition to the set of processes selected by other means.  An alternate description is that this option causes ps to list all processes owned by you (same EUID as ps), or to list all processes when used together with the a option.

j      BSD job control format.

-j     Jobs format.

f      ASCII art process hierarchy (forest).

-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.

尤其是fand-f选项,似乎-f没有输出层次关系的意义。

我比较了这两个命令的输出,除了几行之外,它们几乎相同。

lightxy233@iZ8vb0rgcfh3yx60rzee1jZ:~$ ls
_axjf.txt  axjf.txt
lightxy233@iZ8vb0rgcfh3yx60rzee1jZ:~$ diff _axjf.txt axjf.txt
81c81
<       2  639305       0       0 ?             -1 I        0   0:00  \_ [kworker/u4:0-flush-252:0]
---
>       2  639305       0       0 ?             -1 I        0   0:00  \_ [kworker/u4:0-events_unbound]
126,127c126,127
<  630827  630830  630830  630830 pts/0     641497 Ss    1000   0:00  |       \_ -bash
<  630830  641497  641497  630830 pts/0     641497 R+    1000   0:00  |       |   \_ ps axjf
---
>  630827  630830  630830  630830 pts/0     641448 Ss    1000   0:00  |       \_ -bash
>  630830  641448  641448  630830 pts/0     641448 R+    1000   0:00  |       |   \_ ps -axjf
129c129
<  630845  641496  630845  630845 ?             -1 S     1000   0:00  |           \_ sleep 1
---
>  630845  641447  630845  630845 ?             -1 S     1000   0:00  |           \_ sleep 1

我认为这可能涉及混合不同风格的 ps 命令,但我还没有找到很好的解释。

ps
  • 1 个回答
  • 34 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve