return code of a unix command

How to find out whether the command I executed is successful or unsuccessful(at commandlinet)

Eg:
say i execute the following command at command line
rm *
How do i find out whether my previous command is a success or failure.

Thankyou.

Best Regards,
Ram.

Note: rm * can be very dangerous, be careful

<some command>
echo "$?"

will display 0 if "some command" was successful. It will show 1 (or another non-zero number) if the command failed. Usually commands also display error messages when something goes wrong.