Linux: BASH Shell Misc Tips

By Xah Lee. Date:

How to find the exit code of last shell command?

In bash, echo $? prints the exit code of last command.

kill, bash builtin or /bin/kill ?

If you are using bash, type type kill to find out.

In Ubuntu 12.04, clearly it's calling the bash version. You can confirm by comparing the output of:

kill -l

/bin/kill -l

Linux, Bash and Terminal