Quickly find which shell processes are running on a Linux host and inspect how they were started. 16.11.2025 | reading time: 2 min Want to know which shells run on a machine right now? Use the ps snapshot to list processes and filter for common shells like bash or zsh to see PIDs, owners and command lines. Live example Here is a short demonstration showing two practical ps commands and their typical output: ```$ ps -eo pid,ppid,user,tty,comm,args | grep -E '(bash|zsh|ksh|sh)' | grep -v grep 2045 1023 alice pts/0 bash -bash 3056 2045 alice pts/1 zsh zsh $ ps -C bash,zsh -o pid,tty,cmd 2045 pts/0 -bash 3056 pts/1 zsh``` Inspect and refine Customize the output with -o to show only fields you need, use -p to inspect a specific PID, or -C to select by command name; remember that ps shows a static snapshot, so use watch or top if you need continuous monitoring. Practical uses Use ps to audit who is running interactive shells, find background shells left by scripts, verify login shells for troubleshooting, or incorporate a ps check into a maintenance script that ensures no unexpected shell processes remain. Complementary utilities ps is great for a quick snapshot, but combine it with pgrep to match names, pstree to view parent/child relationships, lsof to find open files held by a shell, and who or w to correlate shells with logged-in users. Final thought Mastering ps options takes seconds and pays off in faster diagnostics; if you want structured training and exam-focused practice consider deepening your skills toward CompTIA Linux+ or LPIC-1 with intensive preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. processes utilities troubleshooting