To show the current PID what command should be execute?
-
echo$$
-
echo$PID
-
echo$USER
-
echo$user
A
Correct answer
Explanation
To show the current PID, you should use the command 'echo$$'. The $$ special variable in shell scripting returns the process ID of the current shell. Option B is incorrect because \$PID is not a valid variable. Option C is wrong as \$USER shows the username, not PID. Option D is incorrect because $user is also not a valid PID variable.