← Back to Bash Course | Chapter 10: Text Processing Tools | Lesson 1 of 12

The ps Command

In this page:

  1. The ps Command

The ps Command

ps lists currently running processes, showing information like process ID (PID), status, and the command that started them. ps aux is a common invocation showing all processes for all users with detailed columns. It's the primary tool for inspecting what's running on a system.

Note: Pipe ps aux into grep to find a specific process by name, e.g. ps aux | grep myscript.

Example: The ps Command

bash
#!/bin/bash
echo "Current shell's PID: $$"
ps -p $$
🔒

Chapter Quiz — Complete all 12 topics to unlock

0/12 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.