How to Eject a Cd/Dvd from the Command Line
I've Just Right Clicked on the Dvd Icon in the Unity Launcher in Order to Eject It, but Instead of Hitting the 'Eject' Button, I Missed and Hit the 'Unlock...
I've just right clicked on the DVD icon in the Unity Launcher in order to eject it, but instead of hitting the 'Eject' button, I missed and hit the 'Unlock from Launchpad' option instead.
How do I go about ejecting the disk from the drive now that the Launcher option is missing?
6 Answers
In order to eject a disk from the drive, whether it's a CD or a DVD, open a terminal and simply execute the eject command.
To open the CD drive / eject the CD:
- Open Terminal using Ctrl+Alt+T, and type
eject - To close the tray, type
eject -t - And to toggle (if open, close and if closed, open) type
eject -T
All these commands can be typed into the run dialogue (Alt+F2)
For more options, type eject -h into Terminal.
Opening the Tray
Commands:
- open tray:
eject - close tray:
eject -t
Must Read
Easy Function for .bashrc
alias opentray='eject'
A few issues arise when ejecting drives. Sometimes they don't want to eject, because they are mounted etc. You can override this with eject -l /media/mountpoint or (/mnt/mountpoint). I wrote a function that can be called by simply typing opentray on your command line.