LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

eject

removable media ejection utility

TLDR

Display the default device
$ eject [-d|--default]
copy
Eject the default device
$ eject
copy
Eject a specific device
$ eject [/dev/cdrom]
copy
Toggle tray open/closed
$ eject [-T|--traytoggle] [/dev/cdrom]
copy
Eject a cd drive
$ eject [-r|--cdrom] [/dev/cdrom]
copy
Eject a floppy drive
$ eject [-f|--floppy] [/mnt/floppy]
copy
Eject a tape drive
$ eject [-q|--tape] [/mnt/tape]
copy
Set whether physical button is ignored
$ eject [-i|--manualeject] [on|off]
copy

SYNOPSIS

eject [options] [device|mountpoint]

DESCRIPTION

eject ejects removable media such as CDs, DVDs, floppy disks, and tape drives. It can also control the tray mechanism and lock/unlock devices.
The default order for device types is cd-rom, scsi, floppy, then tape.

PARAMETERS

-d, --default

Display the default device
-T, --traytoggle
Toggle tray open/closed state
-r, --cdrom
Eject using CD-ROM method
-f, --floppy
Eject using floppy method
-q, --tape
Eject using tape method
-i, --manualeject on|off
Control whether physical button works
-t, --trayclose
Close the tray

CAVEATS

Device must be unmounted before ejection. Some drives don't support all features. Requires appropriate permissions on the device.

SEE ALSO

mount(8), umount(8)

Copied to clipboard
Kai