Bird
0
0

What will be the output of the command ps -e | grep sshd if the sshd process is running?

medium📝 Command Output Q13 of 15
Linux CLI - Process Management
What will be the output of the command ps -e | grep sshd if the sshd process is running?
AIt will show the sshd process details in the list.
BIt will show an error because grep cannot be used with ps.
CIt will show all processes except sshd.
DIt will show nothing because sshd is filtered out.
Step-by-Step Solution
Solution:
  1. Step 1: Understand ps -e and pipe to grep

    ps -e lists all processes; piping to grep sshd filters lines containing 'sshd'.
  2. Step 2: Interpret the output if sshd is running

    If sshd is running, its process line will appear in the output.
  3. Final Answer:

    It will show the sshd process details in the list. -> Option A
  4. Quick Check:

    ps -e | grep sshd shows sshd if running [OK]
Quick Trick: Pipe ps output to grep to find specific processes [OK]
Common Mistakes:
  • Thinking grep causes error with ps
  • Assuming grep excludes matching lines
  • Believing sshd won't appear if running

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes