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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

eject Command Examples in Linux

by admin

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.

eject Command Examples

1. To eject the default removable device:

# eject

2. To eject a cdrom:

# eject cdrom
# eject /dev/cdrom

3. To eject removable media using mount point:

# eject /mnt/cdrom

4. To eject the disk device:

# eject hdd
# eject sda
# eject sda4

5. To display the message when ejecting:

# eject -h cdrom

6. To run eject in verbose mode:

# eject -v cdrom

7. To list the default device name:

# eject -d cdrom

8. To control the auto-eject device:

# eject -a on cdrom
# eject -a 1 cdrom
# eject -a off cdrom
# eject -a 0 cdrom 

9. To select the cd slot from multi device:

# eject -c 2 cdrom

10. To control locking of the hardware eject button:

# eject -i on cdrom 
# eject -i 1 cdrom 
# eject -i off cdrom 
# eject -i 0 cdrom

11. To give a close CD-ROM tray also:

# eject -t cdrom

12. To give the drive is given a CD-ROM tray close command if itâs opened:

# eject -T cdrom

13. To give the speed:

# eject -x 8x

14. To detect the cd drive speed:

# eject -X cdrom

15. To display the selected device:

# eject -n cdrom

16. To specify that the drive should be ejected using cdrom eject command:

# eject -r cdrom

17. To specify that the drive should be ejected using SCSI eject command:

# eject -s sda

18. To specify that the drive should be ejected using floppy disk eject command:

# eject -f fd0

19. To specify that the drive should be ejected using tape drive offline eject command:

# eject -t cdrom

20. To allow you to use /proc/mounts instead /etc/mtab

# eject -p cdrom

21. To allows eject to work with device drivers which automatically mount removable media:

# eject -m usb

22. To display the program version:

# eject -V

Filed Under: Linux

Some more articles you might also be interested in …

  1. addr2line Command Examples in Linux
  2. After Reboot RAID1 Disk Gets Removed/Out of Sync (CentOS/RHEL)
  3. Beginners Guide to yum Configuration
  4. opkg Command Examples in Linux
  5. hwclock: command not found
  6. po4a-updatepo Command Examples in Linux
  7. mtr: command not found
  8. jpegtran: command not found
  9. Wallch (Wallpaper Changer) – Rotate Ubuntu Desktop Wallpapers
  10. xargs Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright