ps
The command that lists running processes with details such as process ID, CPU use and command name.
In more detail
ps aux shows every process on the machine, and -o chooses columns, as in ps -eo pid,pcpu,comm. ps -p $$ -o comm= prints the name of the program running your current shell.
Example
ps -eo pid,pcpu,comm | sort -k2 -nr | head -n 3Related terms
- process — A program that is currently running, with its own memory and a numeric identifier.
- process ID — The number the kernel gives each running process so it can be told apart from all the others.
- pgrep — The command that prints the process IDs of processes whose name matches a pattern.
- top command — The top command, which shows a live, regularly refreshed list of processes sorted by CPU use.
Taught in
- Which Shell Am I In, And Getting Bash Five — Bash Scripting & Command Line Automation
- Processes, Jobs And Signals — Bash Scripting & Command Line Automation
- Scheduling, Monitoring And A Script That Reports — Bash Scripting & Command Line Automation
- The Host Footprint: Six Doors On A Worker — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Mock Exam: Seventeen Security Tasks Against The Clock — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Two Managers Down: The Night The Swarm Froze — Docker Certified Associate (DCA) Exam Prep
- One Option At A Time: How DOMC Changes The Exam — Docker Certified Associate (DCA) Exam Prep
- From docker run To docker service: Replicas, Global Mode And Updates — Docker Certified Associate (DCA) Exam Prep
- One File, Five Services: Stacks From Compose Files — Docker Certified Associate (DCA) Exam Prep
- Where Do The Tasks Land? Labels, Constraints And Templates — Docker Certified Associate (DCA) Exam Prep
- Stuck In Pending: Troubleshooting Services And Reading docker inspect — Docker Certified Associate (DCA) Exam Prep
- Orchestration Sprint: Eight Calls In Eight Minutes — Docker Certified Associate (DCA) Exam Prep
- It Works On The Host: Publishing Ports And Tracing Connections — Docker Certified Associate (DCA) Exam Prep
- Works On My Laptop: Images, Containers, Volumes And Networks — CompTIA Linux+ (XK0-006) Exam Prep
- Containers: Run, Publish, Persist, And Configure The Engine — Linux Foundation Certified System Administrator (LFCS) Exam Prep
- SELinux: Modes, Labels, Ports And Booleans That Last — Linux Foundation Certified System Administrator (LFCS) Exam Prep
- Performance Triage: Processor, Memory Or Disk? — Linux Foundation Certified System Administrator (LFCS) Exam Prep
- Processes: Priorities, Monitors And Long Jobs — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep
References
Certification courses
- CKS course and practice exam: Certified Kubernetes Security Specialist
- DCA course and practice exam: Docker Certified Associate
- CompTIA Linux+ course and practice exam: XK0-006
- LFCS course and practice exam: Linux Foundation Certified System Administrator
- LPIC-1 course and practice exam: Linux Administrator (101-500 and 102-500)