Linux eject Command
The Linux eject command is used to eject removable devices.
If the device is mounted, eject will first unmount it before ejecting.
Syntax
eject [-dfhnqrstv][-a <switch>][-c <cdrom number>][device]
Parameter Description:
[device] The device can be a driver name or a mount point.
-a<switch> or --auto<switch> Controls the auto eject feature of the device.
-c<cdrom number> or --changerslot<cdrom number> Selects a CD-ROM drive in the changer.
-d or --default Displays the default device instead of performing the action.
-f or --floppy Ejects a removable disk.
-h or --help Displays help.
-n or --noop Displays the specified device.
-q or --tape Ejects a tape.
-r or --cdrom Ejects a CD.
-s or --scsi Uses SCSI commands to eject the device.
-t or --trayclose Closes the CD tray.
-v or --verbose Displays detailed information while executing.
Examples
# eject // ejects by default without parameters
# eject -r /dev/cdrom // specifies the device