ps -? Flashcards
What are the types of options that ‘ps’ will accept?
UNIX options, ps -e
BSD options, ps aux
GNU options, –headers
What commands use UNIX options to list every process on the system with no exceptions?
ps -e
ps -A (Yeah it’s identical to -e)
Which BSD-style flag causes ps to also display processes not owned by the user that is running ps?
‘a’ – this ‘all’ flag removes a restriction (apparently it’s convention on BSD systems) preventing the display of processes not owned by the user. It does not affect other restrictions, like the one restricting the display of processes that are not run on TTY
example:
ps a
Which BSD-style flag enables ps to also display processes that do not have an associated tty?
‘x’ – This flag lifts another BSD-style restriction that hides all processes without a tty
If the system isn’t running a lot of non tty stuff like a graphical desktop, this flag can help separate user processes that were spawned with a tty from daemon processes that have no associated tty.
This flag does NOT have a UNIX-style equivalent according to the man page.
Example: ps x
What is the flag for full-format listing? This is available in only one of UNIX or BSD styles.
-f, full-format listing is in UNIX-style only
What is the flag for extra full format? Available in only one of UNIX or BSD style.
-F, this F is capital because it has even more columns
What flag sets job-control format to show various IDs related to the process: PPID, PGID, SID, TGID, STAT, and UID
UNIX: -j
BSD: j
What UNIX and BSD style flags are analogous to –pid?
UNIX: -p
BSD: p
“Select by process id”
Example:
ps p 1337
The following are all equivalent (except if you use BSD flags you will get the BSD columns instead of UNIX columns)
ps -p 1337 ps p 1337 ps --pid 1337 ps -1337 ps 1337
You may only select processes by PPID with what flag?
–ppid, this is only available as a GNU-style flag
How to select all processes from ‘this’ terminal?
T, or t with no argument
Example:
ps T
By default, ps selects all processes based on two parameters. One of them is that they must be from the same tty that is running ps. What is the other parameter?
Only processes with the same ‘effective’ EUID will be shown.
To remove this filter, use the ‘a’ BSD-style flag. There are alternatives but they are messed up enough to get their own card.
By default, ps selects all processes based on two parameters. One of them is the Effective User ID of the processes must match the EUID of the user running ps. What is the other parameter?
Only processes associated with the current terminal are shown. To remove this filter, use the ‘x’ BSD-style flag. Alternatively, you can add terminals to the search with ‘-t, t, –tty’
If you would like to add EUIDs to the list, what flags should you use?
‘U, -u, user’. That is uppercase U for BSD, lowercase -u for UNIX, lowercase –user for GNU
If you want to add a ‘real’ RUID to the search, what flags should you use?
’‘-U, –User” that is capital -U for UNIX and capital –User for GNU. There is no documented BSD-style flag for this.
Which UNIX-style flag shows process hierarchy with indentation?
-H