OS Manuals

/usr/bin/eject

Misc binaries for util-linux

From util-linux-misc 2.42.4-r2 (os), captured 2026-11-05 by running eject --help (exit 0). permalink

Usage:
 eject [options] [<device>|<mountpoint>]

Eject removable media.

Options:
 -a, --auto <on|off>         turn auto-eject feature on or off
 -c, --changerslot <slot>    switch discs on a CD-ROM changer
 -d, --default               display default device
 -f, --floppy                eject floppy
 -F, --force                 don't care about device type
 -i, --manualeject <on|off>  toggle manual eject protection on/off
 -m, --no-unmount            do not unmount device even if it is mounted
 -M, --no-partitions-unmount do not unmount another partitions
 -n, --noop                  don't eject, just show device found
 -p, --proc                  use /proc/mounts instead of /etc/mtab
 -q, --tape                  eject tape
 -r, --cdrom                 eject CD-ROM
 -s, --scsi                  eject SCSI device
 -t, --trayclose             close tray
 -T, --traytoggle            toggle tray
 -v, --verbose               enable verbose output
 -x, --cdspeed <speed>       set CD-ROM max speed
 -X, --listspeed             list CD-ROM available speeds

 -h, --help                  display this help
 -V, --version               display version

By default tries -r, -s, -f, and -q in order until success.

For more details see eject(1).
Options (20)
OptionDescriptionSource
-a, --auto on|offThis option controls the auto-eject mode, supported by some devices.help + man
-c, --changerslot slotWith this option a CD slot can be selected from an ATAPI/IDE CD-ROM changer.help + man
-d, --defaultList the default device name.help + man
-f, --floppyThis option specifies that the drive should be ejected using a removable floppy disk eject command.help + man
-F, --forceForce eject, don’t check device type, don’t open device with exclusive lock.help + man
-i, --manualeject on|offThis option controls locking of the hardware eject button.help + man
-m, --no-unmountThe option tells eject to not try to unmount at all.help + man
-n, --noopWith this option the selected device is displayed but no action is performed.help + man
-p, --procThis option allows you to use /proc/mounts instead /etc/mtab.help + man
-q, --tapeThis option specifies that the drive should be ejected using a tape drive offline command.help + man
-r, --cdromThis option specifies that the drive should be ejected using a CDROM eject command.help + man
-s, --scsiThis option specifies that the drive should be ejected using SCSI commands.help + man
-t, --traycloseWith this option the drive is given a CD-ROM tray close command.help + man
-T, --traytoggleWith this option the drive is given a CD-ROM tray close command if it’s opened, and a CD-ROM tray eject command if it’s closed.help + man
-v, --verboseenable verbose outputhelp + man
-x, --cdspeed speedWith this option the drive is given a CD-ROM select speed command.help + man
-X, --listspeedWith this option the CD-ROM drive will be probed to detect the available speeds.help + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man
-M, --no-partitions-unmountThe option tells eject to not try to unmount other partitions on partitioned devices. (in the manual page but not in --help)man
Exit status (2) from the manual page
0operation was successful
1operation failed or command syntax was not valid

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.