Computer Hacking Forensic Investigator (CHFI v10) — Question 307
Which of the following Linux command searches through the current processes and lists the process IDs those match the selection criteria to stdout?
Answer options
- A. pstree
- B. pgrep
- C. ps
- D. grep
Correct answer: B
Explanation
The correct answer is B, pgrep, as it specifically searches for processes based on given criteria and returns their IDs. Option A, pstree, displays the processes in a tree format and does not provide IDs based on selection criteria. Option C, ps, lists currently running processes but does not filter based on specific criteria like pgrep does. Option D, grep, is a text search utility and is not used for searching process IDs.