The command ps -Af will display a listing of all processes running on the same m
ID: 3711866 • Letter: T
Question
The command ps -Af will display a listing of all processes running on the same machine as you are. This includes processes being run by lots of other people. Part of the information shown is the name of the command that launched the process. It also will show the login name of the account that launched that process. Try it now and examine its output.
One of the most common processes that you will see is sshd, the process that accepts an incoming ssh connection like the ones that you have opened for this assignment.
What command would you enter to get a count of the number of sshd processes running on the machine where you are logged in?
Must use ps -Af
Answer is: ps -Af | grep sshd | wc
Explanation / Answer
Answer:
ps -Af > This command will list down all the Processes running in the system with ProcessID
ps -Af | grep sshd > This command will list down all the sshd processes running in the system with the Process id
ps -Af | grep sshd | wc -l > This command will print the number of lines that the command(ps -Af | grep sshd) will return.
The correct command to count the number of running sshd processes is ps -Af | grep sshd | wc -l