1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/unix/pid-of-the-current-shell.md
2016-05-27 12:02:11 -05:00

358 B

PID Of The Current Shell

$ expands to the process ID of the shell. So, you can see the PID of the current shell with echo $$.

> echo $$
36609

> zsh

> echo $$
45431

> exit

> echo $$
36609

See the Special Paramaters section of man bash for more details.

source