How to get the running process’ pid in Bash? Posted on Mar 24, 2018 by Q A In QA How to get the running process’ pid in Bash? In Bash, you can get the process ID from the variable $$. Note that in a subshell invoked by ‘(…)‘, $$ is actually the parent process’ pid. In Bash 4, you can also use $BASHPID to get the process pid. Read more: Getting the running process’ own pid in Python How to get the running process’ pid in Go? How to get the running process’ parent process’ ID in Bash? How to get the running process’ parent process’ ID in C / C++? How to get the running process’ parent process’ ID in Python? How to get the running process’ parent process’ ID in Go? Killing Running Bash Script Process Itself and All Child Processes In Linux Getting Process Own Pid in C and C++