Shell
$$
PID of the current shell or script process.
Ubuntu
Debian
Arch
Fedora
CentOS
SUSE
Alpine
macOS
FreeBSD
Verified: 2026-05-12
Syntax
$echo $$
Examples
$echo $$
$tmpfile=/tmp/script.$$
Typical use cases
?
Standard usage
$$ --help
Note
Useful for unique temporary filenames in scripts.
Export