To see the result code from a failed command, do this at the shell prompt immediately after issuing the (failed) command:

echo $?