Skip to content
DevMeme
4769 of 7590
OperatingSystems Post #5224 · source on Telegram

Linux wisdom: every socket, device, and process is a file - be brave

Description

The image has a white background with the classic black-and-white Tux penguin mascot sitting on the left. On the right, in large pastel-blue sans-serif letters, the text reads: “Everything… is a file.” Beneath that, in a slightly smaller font, it adds: “If you're brave enough.” The composition humorously summarizes the Unix/Linux philosophy that everything - from /dev/null to /proc/1234/fd - can be accessed through the filesystem abstraction. Seasoned engineers will recognize the joke about treating devices, sockets, and even pseudo-files as ordinary file descriptors when working at the CLI or writing low-level code

Comments

29
Anonymous ★ Top Pick In Linux everything is a file - ask the intern who echoed “b” into /proc/sysrq-trigger and proved an unscheduled reboot is just a write operation
  1. Anonymous ★ Top Pick

    In Linux everything is a file - ask the intern who echoed “b” into /proc/sysrq-trigger and proved an unscheduled reboot is just a write operation

  2. Anonymous

    The beauty of 'everything is a file' hits different when you realize you can accidentally dd your entire production database to /dev/null because someone symlinked it to look like a log file during a 3am incident response. At least the write performance was incredible

  3. Anonymous

    Ah yes, the Unix philosophy: everything is a file... until you try to `cat /dev/urandom` and your terminal becomes a modern art installation, or accidentally `dd` to the wrong 'file' and realize that treating your entire disk as a writable stream was perhaps too much abstraction. The beauty of this design is that it's elegant until you're debugging why your socket won't `fseek()` or explaining to a junior dev why they can't just `vim /proc/self/mem` to patch their running process. But hey, at least we're consistent - consistently terrifying

  4. Anonymous

    Unix mantra: everything's a file - until 'echo 1 > /proc/sysrq-trigger' tests your bravery at 3AM

  5. Anonymous

    “Everything is a file” is beautiful - until ioctl and netlink show up with the asterisked appendix

  6. Anonymous

    Linux says everything is a file; real bravery is fixing prod with echo > /proc and realizing the “memory leak” was ulimit -n and 50k open FDs

  7. @declonter 3y

    Ha-ha, classic

    1. @azizhakberdiev 3y

      So russian people are the bravest creatures in the entire universe

      1. @declonter 3y

        Are you JS coder or just a stupid?

        1. @mekosko 3y

          Just a troll

        2. @azizhakberdiev 3y

          Yes and no

          1. @declonter 3y

            Oh, now I see... Continuing the dialogue is pointless

            1. @azizhakberdiev 3y

              Why are u judging my IQ lol

              1. @mekosko 3y

                Why do you think he's judging your IQ

                1. @callofvoid0 3y

                  maybe 'cause he ain't got other classes to implement Judgables

                2. @declonter 3y

                  Don't try to understand. His baseless claims - a symptom of JS. His brain now is unreasonable, illogical irrational. Forget ;)

                  1. @callofvoid0 3y

                    and non-binary

                  2. @azizhakberdiev 3y

                    I could tell some russian rude words to clarify my base, but joke stops being a joke if I start explaining everything. And just because your narrow worldview didn't allow you to get the joke you choose to publicly insult me. Majority of JS coders perhaps are smarter than you

        3. Deleted Account 3y

          both

  8. @doodguy1991 3y

    Treat bitches like files. sudo rm -rf and all

  9. 扇子 3y

    hol up is a folder a file

    1. @callofvoid0 3y

      a folder is just a an array of pointers

      1. @im_ali_pj 3y

        so what about symlinks?

        1. @RiedleroD 3y

          symlinks are files containing a path. It's ofc a special type of file, but still a file

          1. @RiedleroD 3y

            hard links work entirely differently and to explain those you actually need some understanding of how file systems work internally.

  10. @DrPratyash 3y

    Everything is a pointer if you're brave enough

    1. @RiedleroD 3y

      but if everything's a pointer, where is the data? I don't think I'm brave enough

      1. @DrPratyash 3y

        What is data, nothing but just 0s and 1s stored at memory locations where pointers are pointing at?

        1. @RiedleroD 3y

          yeah

Use J and K for navigation