The following command will eject a DVD or CD from the Macbook Pro’s drive:
Note that you may need to be “root” in order to successfully complete this operation. If you get an error saying something to this effect, try
sudo drutil eject
and enter your password when prompted.