Could someone please let me know what does it mean when I type
$? in Unix?
root@kb:~# echo $? 127 root@kb:~# wc -l root@kb:~# root@kb:~# echo $? 130
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
As the comments say, "$?" holds the return status code from the last command executed. Each command is free to return whatever value it wants, and those values mean whatever they say in the man page for that particular command, but in general, most unix commands return zero (0) on successful completion, and various non-zero (usually positive) numbers to indicate a variety of exit conditions.
A few sample "special" exit codes can be found here: