I’ve been using linux for more than a decade at this point, but in all that time I’ve rarely had a disk drive. The fact that this command exists and is just, one of the core utils included with your distro along with su and kill and mount and more is just… so beautiful. 10 years amore with this OS and I’m still learning things that the elders in the audience are snickering at me for only learning 5 minutes ago while they were popping their disk trays open with a single command back when disk drives were a non optional component.

  • Captain Aggravated
    link
    fedilink
    English
    2816 hours ago

    tilts head

    plugs in USB optical drive

    eject

    pop

    hehe

    push tray back in

    eject

    pop

    hehehe

  • @[email protected]
    link
    fedilink
    English
    7
    edit-2
    13 hours ago

    There is a whole world of obsolete stuff nobody will ever do with a linux system anymore. Terminal servers with lots of serial terminals or modems for a BBS. Making a fax server, IVR, digital answering machine for analog land lines. Using removable optical or magnetic media. Recording broadcast tv. SCSI, Firewire. It is interesting to imagine what from today will be obsolete in a few years.

  • @Reddfugee42
    link
    English
    1016 hours ago

    Those are discs not disks kiddo

  • @[email protected]
    link
    fedilink
    English
    520 hours ago

    woa what the frick!! that actually scared me it’s like 2001 space odyssey type of stuff

  • @[email protected]
    link
    fedilink
    English
    1092 days ago

    This command was very useful for quickly finding a server in a row of hundreds of identical servers. No need to read the labels or look up which rack it’s in. Just log in remotely, just use ‘eject’, and then walk down the row to the server that has its tray out.

  • @[email protected]
    link
    fedilink
    522 hours ago

    I still have a disk drive but eject doesn’t seem to affect it since for some reason I don’t have a /dev/cdrom. I just checked with the physical eject button on the drive and it is at least still physically working—the tray ejects! I don’t have any optical media to test if the drive still works to read CDs though

    • @[email protected]
      link
      fedilink
      321 hours ago

      Try eject /dev/sr0, that should be your disk drive if it is attached via SATA or USB. /dev/cdrom is usually just a symlink.

      • @[email protected]
        link
        fedilink
        1
        edit-2
        20 hours ago

        Afraid I don’t have a /dev/sr0. Tbh I built this PC yonks ago, I don’t remember how I plugged in my optical drive. I assume SATA would be the sensible and most likely option.

        I’m on Artix Linux with runit if that matters at all?

        I mean, it doesn’t matter to me whether or not I can eject my optical drive with a command, but at this point I’m just curious as to where the drive is on the filesystem lol

        Edit: I tried loading sr_mod with modprobe sr_mod (which wasn’t loaded for me) but still not seeing any sr* or cdrom in /dev. Again, not too bothered about this, but I’m kinda curious.

        • @zzx
          link
          119 hours ago

          Connected power but not SATA maybe?

          • @[email protected]
            link
            fedilink
            15 hours ago

            Maybe? I remember I have used it to read optical discs before (on Linux too) and I don’t think I’ve unplugged anything

  • @DeuxChevaux
    link
    1502 days ago

    Very helpful command it was for those, whose modem had to be rebooted daily back in the day: Have a cron-job open the tray, which in turn was placed strategically so that it would hit the reset button of the modem, then close the tray. And voilà; automatic reboot of the modem. Robotics at its finest!

    • arthurpizza
      link
      English
      817 hours ago

      In the early 2000s, only my rich friends had cell phones. My roommate and I both had accounts on each other’s machines so we could telnet into them on the same local network.

      We used to do this all the time to each other. It was funny to us 25 years ago. It’s still funny now.

  • Courant d'air 🍃
    link
    fedilink
    552 days ago

    Back in networking classes we used to have entire rooms of replicated machines, all with contiguous addresses and same logins. We wrote a script to ssh into every computer of the room and eject and retract all the disk drives at the same time, it was wonderful ✨

    • Tekhne
      link
      fedilink
      3
      edit-2
      8 hours ago

      You could’ve made music out of ejecting/retracting those all at different times!

      Would’ve actually been fantastic distributed systems practice, synchronizing all of those to tight tolerances of music across a network connection…

  • @netvor
    link
    41 day ago

    lemme guess… and inject would close it again?

    • @hellfroze
      link
      English
      5
      edit-2
      21 hours ago

      eject -t

      There’s also eject -T which is a toggle.

  • @markstos
    link
    732 days ago

    You mean the cup holder?

  • Björn Tantau
    link
    fedilink
    832 days ago

    Ah, the good old days of sshing into a family member’s computer and trolling them by constantly opening and closing the drive.

    • Khrux
      link
      fedilink
      English
      132 days ago

      It it to wait 30 mins then do it every 10, and pop it in startup, those were the days.

      The other was Free_Cupholder.EXE. I miss disk drives for this reason more than for actual use.