Name

eject

Synopsis

    eject [options] [media]

Solaris and GNU/Linux only. Eject removable media, such as a floppy disk or CD-ROM. On Solaris, necessary for media being managed by vold, or for media without an eject button, such as the floppy drives on some Sun SPARC systems. media is either a device name or a nickname, such as floppy or cdrom.

With volume management available, eject unmounts any filesystems mounted on the named media. In this case, it also displays a pop-up dialog if a window system is running. Without volume management, it simply sends an “eject” command to the given device.

On GNU/Linux, the default device is cdrom. A device name or mount point may be supplied.

Solaris Options

-d

Print the name of the default device to be ejected.

-f

When volume management is not in effect, force the eject, even if the device is busy.

-n

Display the list of nicknames and their corresponding real devices.

-p

Do not use a windowing pop-up dialog.

-q

Query to see if the device has media. Use the exit status to determine the answer.

GNU/Linux Options

-aon|1|off|0, --autoon|1|off|0

Set the auto-eject mode to on or off (equivalent to 1 or 0). If auto-eject mode is on, the device is ejected when closed or unmounted.

-cslotnumber, --changerslotslotnumber

If using a CD-ROM changer, select a CD from one of the slots. Slots are enumerated starting with 0, and the CD-ROM drive must not be playing music or mounted to read data.

-d, --default

List the default device name rather than doing anything.

-f,

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.