Inspect every process on the system.
Use the POSIX full format including UID, PID, PPID, start time, and command.
Which ps specification is correct?
ps -ef combines -e, which selects every process, with -f, which requests full-format columns such as UID and PPID.
Detailed explanation
psIncorrect. Plain ps generally shows only processes associated with the current terminal.
Incorrect. Plain ps generally shows only processes associated with the current terminal.
ps -efCorrect. -e selects all processes and -f displays the full format.
Correct. -e selects all processes and -f displays the full format.
ps -p 1Incorrect. -p 1 selects only the process with PID 1.
Incorrect. -p 1 selects only the process with PID 1.
ps -fIncorrect. -f changes the format but does not select all processes.
Incorrect. -f changes the format but does not select all processes.
Try it yourself
An example you can run in a temporary verification environment.
ps -ef | head -n 1Expected result
UID、PID、PPID、C、STIME、TTY、TIME、CMD等の見出し(実装により表記差あり)Key points
- -e selects all processes
- -f requests full format
- Selection and display format are separate
Notes
- Environment: procps-ng 4.x
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.