• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

eject: command not found

by Deepika

eject Command ejects removable media such as a CD, DVD, floppy, or tape. You may name the device by its /dev or /mnt filename. The /dev and /mnt prefixes are optional for any items in the /dev and /mnt directories. If no device is named, it is assumed that “cdrom” should be ejected.

Syntax:

eject [options] [device]
Note: Only devices that support eject under program control respond to this command.

If you encounter the below error while running the command eject:

eject: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install eject
Ubuntu apt-get install eject
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install eject
CentOS yum install eject
Fedora dnf install util-linux
OS X brew install eject
Raspbian apt-get install eject

eject Command Examples

1. Display the default device:

# eject -d

2. Eject the default device:

# eject

3. Eject a specific device (the default order is cd-rom, scsi, floppy and tape):

# eject /dev/cdrom

4. Toggle whether a device’s tray is open or closed:

# eject -T /dev/cdrom

5. Eject a cd drive:

# eject -r /dev/cdrom

6. Eject a floppy drive:

# eject -f /mnt/floppy

7. Eject a tape drive:

# eject -q /mnt/tape

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to add iptable rules
  2. fdroidcl – F-Droid CLI client
  3. fprintd-delete: command not found
  4. lt Command Examples
  5. k8s-unused-secret-detector Command Examples
  6. Understanding Mac file timestamps
  7. “git range-diff” Command Examples
  8. How to Calculate Memory Usage in Linux using sar, ps, and free
  9. pacstrap: command not found
  10. powertop Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright