We very often use the inbuilt variable $? in linux to check the status of last command used.
To find if the last command is correctly executed, we fire echo $? always. If it return 0, the command is successfully completed else some error occured while executing the command.
See below example.
shankys:~> date
Wed May 11 06:50:07 CEST 2016
shankys:~> echo $?
0
shankys:~> date 9
...
Read more »