Check current running shell process
Just run any of these commands on the server:
Check current running shell process
Just run any of these commands on the server:
Link to read full article.
[embed]Check current running shell process Just run any of these commands on the server:medium.com
Quickest Way
echo $SHELL
Output examples:
OutputMeaning/bin/bashRunning bash/bin/kshRunning ksh/bin/zshRunning zsh/bin/shRunning sh
Other Ways to Check
# Option 2 — shows current running shell process
ps -p $$
# Option 3 - shows shell name only
ps -p $$ -o comm=
# Option 4 - check shell variable
echo $0
Example Output of ps -p $$
PID TTY TIME CMD
12345 pts/0 00:00:00 ksh ← your current shell
Difference Between $SHELL and $0

Quick One-liner (Most Reliable)
ps -p $$ -o comm=
This always shows exactly what shell you’re currently in. ✅
메타데이터
- post_id
- 75dae6834c63
- slug
- check-current-running-shell-process-75dae6834c63
- url
- https://blog.devops.dev/check-current-running-shell-process-75dae6834c63
- canonical_url
- https://blog.devops.dev/check-current-running-shell-process-75dae6834c63
- author_url
- https://medium.com/@nirbhaysingh281
- status
- ok
- fetched_at
- 2026-07-10 20:03:45