Open In App

eject command in Linux with examples

eject allows ejecting a removable media (typically a CD-ROM, floppy disk, tape, or JAZ or ZIP disk) using the software. You can also control some multi-disc CD-ROM changers, the auto-eject feature (supported by some devices) and also close the disc tray of some CD-ROM drives. The methods of ejecting depend on the device type, whether it is a CD-ROM, SCSI device, removable floppy, or tape. The default action of eject is that it tries all four methods in order until it achieves success. The device is unmounted, if it is mounted, before ejecting.

Syntax:



eject [...OPTIONS]

Options of the eject command:

Exit Status: On successful operation, 0 is returned, and on failed operation, 1 is returned.

Article Tags :