如何在 Ubuntu 上从 PowerShell Core 获取进程命令行?



我在 Ubuntu 18.04 服务器上。我知道完整的命令行信息可以被ps auxww抓取。例如,通过运行ps auxww,我知道命令/usr/local/bin/my-program -parameter :8888正在运行。如何从 PowerShell 获取相同的信息?我四处搜索,所有信息都是关于如何在Windows上获取命令行信息。

在 Ubuntu 18.04 PowerShell 上

你试过ps -a -F.它应该提供您正在寻找的详细信息。

如果需要有关正在运行/所有进程的特定详细信息,请尝试使用更多选项

ps --help allps --help output命令

PS> ps --help output   
Usage:
ps [options]
Basic options:
-A, -e               all processes
-a                   all with tty, except session leaders
a                   all with tty, including other users
-d                   all except session leaders
-N, --deselect       negate selection
r                   only running processes
T                   all processes on this terminal
x                   processes without controlling ttys
Output formats:
-F                   extra full
-f                   full-format, including command lines
f, --forest         ascii art process tree
-H                   show process hierarchy
-j                   jobs format
j                   BSD job control format
-l                   long format
l                   BSD long format
-M, Z                add security data (for SELinux)
-O <format>          preloaded with default columns
O <format>          as -O, with BSD personality
-o, o, --format <format>
user-defined format
s                   signal format
u                   user-oriented format
v                   virtual memory format
X                   register format
-y                   do not show flags, show rss vs. addr (used with -l)
--context        display security context (for SELinux)
--headers        repeat header lines, one per page
--no-headers     do not print header at all
--cols, --columns, --width <num>
set screen width
--rows, --lines <num>
set screen height
--help <simple|list|output|threads|misc|all>
display help and exit
For more details see ps(1).

最新更新