Você está tentando mapear as opções e as palavras-chave do Linux ps
para as opções e palavras-chave do FreeBSD ps
: esta é uma das principais diferenças óbvias entre um sistema semelhante ao Linux e um estilo BSD.
Primeiro, a opção -e
no FreeBSD ps
significa "Mostrar o ambiente também" .
O que você quer é exibir todos os processos, que é -ax
para o FreeBSD;
-x
é para exibir também processos sem um terminal de controle (processos de kernel e daemons) e o comportamento padrão é não exibi-los.
Em relação ao Linux ps
sobre a seleção por campo (de man ps
):
euser EUSER effective user name. This will be the textual user ID, if it can be obtained and the field width
permits, or a decimal representation otherwise. The n option can be used to force the decimal
representation. (alias uname, user).
ruser RUSER real user ID. This will be the textual user ID, if it can be obtained and the field width permits,
or a decimal representation otherwise.
suser SUSER saved user name. This will be the textual user ID, if it can be obtained and the field width permits,
or a decimal representation otherwise. (alias svuser).
fuser FUSER filesystem access user ID. This will be the textual user ID, if it can be obtained and the field
width permits, or a decimal representation otherwise.
f F flags associated with the process, see the PROCESS FLAGS section. (alias flag, flags).
comm COMMAND command name (only the executable name). Modifications to the command name will not be shown.
A process marked <defunct> is partly dead, waiting to be fully destroyed by its parent. The output in
this column may contain spaces. (alias ucmd, ucomm). See also the args format keyword, the -f option,
and the c option.
When specified last, this column will extend to the edge of the display. If ps can not determine
display width, as when output is redirected (piped) into a file or another command, the output width
is undefined. (it may be 80, unlimited, determined by the TERM variable, and so on) The COLUMNS
environment variable or --cols option may be used to exactly determine the width in this case. The w
or -w option may be also be used to adjust width.
label LABEL security label, most commonly used for SE Linux context data. This is for the Mandatory Access
Control ("MAC") found on high-security systems.
Do FreeBSD ps
manual sobre a seleção de palavras-chave:
uid effective user ID (alias euid)
user user name (from UID)
ruid real user ID
ruser user name (from ruid)
svuid saved UID from a setuid executable
state symbolic process state (alias stat)
comm command
label MAC label
Não há equivalente óbvio para o FreeBSD em fuser , então vamos ignorá-lo.
Então, no seu caso, isso seria traduzido para:
ps -axo user,ruser,svuid,state,comm,label |grep <process_name>