ps -? Flashcards

1
Q

What are the types of options that ‘ps’ will accept?

A

UNIX options, ps -e
BSD options, ps aux
GNU options, –headers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What commands use UNIX options to list every process on the system with no exceptions?

A

ps -e

ps -A (Yeah it’s identical to -e)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which BSD-style flag causes ps to also display processes not owned by the user that is running ps?

A

‘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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which BSD-style flag enables ps to also display processes that do not have an associated tty?

A

‘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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the flag for full-format listing? This is available in only one of UNIX or BSD styles.

A

-f, full-format listing is in UNIX-style only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the flag for extra full format? Available in only one of UNIX or BSD style.

A

-F, this F is capital because it has even more columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What flag sets job-control format to show various IDs related to the process: PPID, PGID, SID, TGID, STAT, and UID

A

UNIX: -j
BSD: j

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What UNIX and BSD style flags are analogous to –pid?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You may only select processes by PPID with what flag?

A

–ppid, this is only available as a GNU-style flag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to select all processes from ‘this’ terminal?

A

T, or t with no argument

Example:
ps T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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?

A

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’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If you would like to add EUIDs to the list, what flags should you use?

A

‘U, -u, user’. That is uppercase U for BSD, lowercase -u for UNIX, lowercase –user for GNU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If you want to add a ‘real’ RUID to the search, what flags should you use?

A

’‘-U, –User” that is capital -U for UNIX and capital –User for GNU. There is no documented BSD-style flag for this.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which UNIX-style flag shows process hierarchy with indentation?

A

-H

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which BSD-style flag shows hierarchy information? Uses ASCII as well as indentation

A

‘f’ stands for ‘forest’

The GNU option –forest does the same thing