What does $? mean in linux?

The $? is called exit code of an application used to run. As an example type following commands in console:
top
then press CTRL-Z and then type:
echo $?
You will see 147 as the answer. Return values more than 128 usually means signal and you have to do the calculation by subtracting 128 from the returned result. In this case you will get 19 which means SIGSTOP

You can read about linux signals using :

man 7 signal

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *