Ejecting a stuck CD or DVD on a Mac

If you have a stuck CD or DVD on your Mac, and the desktop icon for the media has disappeared from the desktop so that you can no longer drag it to the trash, you can manually eject the media without rebooting the machine by executing the following command from the Terminal:

drutil tray eject