Ubuntu – What does “$$” mean in the shell

command line

What does the output of the command below mean? (result is positive integer)

echo $$

Best Answer

The $$ variable in bash and other shells contains the process id of the shell.

See this Stack overflow question and this one also has more detail about what it is more precisely, and commands similar to it.