0
0
Linux CLIscripting~20 mins

ps (list processes) in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Process Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of this command?
You run the command ps -e | grep ssh. What does this command do?
Linux CLI
ps -e | grep ssh
AStarts the ssh service if it is not running.
BLists only ssh processes without showing any other processes.
CShows the ssh service status without listing processes.
DLists all running processes and filters to show only those with 'ssh' in their name or details.
Attempts:
2 left
💡 Hint
Think about what 'ps -e' and 'grep ssh' do separately and then combined.
💻 Command Output
intermediate
1:30remaining
What does this command output?
What is the output of ps -u root?
Linux CLI
ps -u root
ALists all processes owned by the user 'root'.
BLists all processes except those owned by 'root'.
CShows system-wide CPU usage statistics.
DDisplays the current user's processes only.
Attempts:
2 left
💡 Hint
The '-u' option filters processes by user.
📝 Syntax
advanced
2:00remaining
Which command correctly lists all processes with full command line?
You want to see all running processes with their full command lines. Which command is correct?
Aps auxww
Bps -e -o cmd
Cps -ef
Dps -u all
Attempts:
2 left
💡 Hint
Look for options that show all users and full command lines.
🔧 Debug
advanced
1:30remaining
Why does this command fail?
You run ps -u without specifying a user and get an error. Why?
Linux CLI
ps -u
ABecause '-u' is not a valid option for ps.
BBecause '-u' requires a username argument and none was given.
CBecause ps needs root privileges to run '-u'.
DBecause the system has no users defined.
Attempts:
2 left
💡 Hint
Check the man page for the '-u' option.
🚀 Application
expert
2:30remaining
How many processes are running under the current user?
Write a command that counts how many processes are running under your current user and outputs only the number.
Aps -u $(whoami) | wc -l
Bps -U $(whoami) | grep -c .
Cps -u $(whoami) | tail -n +2 | wc -l
Dps aux | grep $(whoami) | wc -l
Attempts:
2 left
💡 Hint
Remember the header line in ps output and how to exclude it.