This Mac tip is provided by Mark Greentree and was originally posted on Mark’s blog – Everyday Mac Support. For more of Mark’s tips visit his site, follow him on Twitter, or browse his archive of posts here.
How To: Ejecting A CD/DVD From The Terminal
The Terminal offers you great control over your computer and one proof of this is when you occasionally get optical media which does not wish to eject using the traditional finder based methods such as dragging to the trash or pressing the eject key on your keyboard.
Simply navigate to your Applications folder and then to your Utilities folder and proceed to Terminal. Launching terminal and you will be presented with a terminal window which looks similar to this:
Now that you have this open simply type: drutil eject 0
An example of this in the Terminal window is shown below:
Simply press return on your keyboard after typing in the command and your disc will be immediately ejected.