this post was submitted on 15 Dec 2025
310 points (98.4% liked)

linuxmemes

28444 readers
1518 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. πŸ‡¬πŸ‡§ Language/язык/Sprache
  • This is primarily an English-speaking community. πŸ‡¬πŸ‡§πŸ‡¦πŸ‡ΊπŸ‡ΊπŸ‡Έ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • Β 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS
    top 43 comments
    sorted by: hot top controversial new old
    [–] AeonFelis@lemmy.world 3 points 2 hours ago
    • Write programs that do one thing and do it well.
    • Write programs to work together.
    • Write programs to handle text streams, because that is a universal interface.

    I guess none of these apply when reading files is involved?

    [–] radiouser@crazypeople.online 2 points 4 hours ago

    Looks like people didn't get the Sublime reference.

    [–] germanatlas@lemmy.blahaj.zone 10 points 14 hours ago

    You know what? I’m gonna cat into grep even harder now

    [–] Atlas_@lemmy.world 49 points 19 hours ago (3 children)

    You can actually change the functionality of some punctuation, such as is used in my favorite command

    :(){:|:};:

    [–] plyth@feddit.org 3 points 2 hours ago* (last edited 2 hours ago)
    [–] Molten_Moron@lemmings.world 33 points 19 hours ago (3 children)

    What the fork does this even do?

    [–] bluesheep@sh.itjust.works 4 points 2 hours ago

    It's results will blow you away!

    [–] NullGator@lemmy.ca 21 points 17 hours ago (1 children)

    Create a function named : which runs :|: (calls itself and pipes the output to itself). Then it closes the function and uses a semicolon to end the function definition. Next run a command :.

    TLDR it's a bash fork bomb

    [–] Molten_Moron@lemmings.world 15 points 9 hours ago (1 children)

    Oh I'm familiar, I was just being punny. Thanks for explaining for those that don't know, though!

    [–] EddoWagt@feddit.nl 4 points 4 hours ago

    I didn't know!

    [–] Dadifer@lemmy.world 11 points 17 hours ago

    Call it for a good time.

    [–] CubitOom 14 points 19 hours ago (1 children)
    [–] 9point6@lemmy.world 10 points 17 hours ago* (last edited 17 hours ago)

    ..... That's awful, does it work?

    Edit: I guess it would need a semicolon or another pipe in the alias

    [–] ultrahamster64@lemmy.world 52 points 21 hours ago (2 children)

    I heard one popular glorp youtuber say "Only glorp hemptets ship into mleb" Bitch I ship into blep all I fucking want, it's more readable, and I piss whenever I fucking can. I piss two pisses before I piss two pisses, and then I piss more

    Yes I know putting two pisses in a row will break your bone. I've done it several times before by accident.

    implying I give a fuck

    [–] Gonzako@lemmy.world 2 points 5 hours ago

    Cat outputs your files text and grep searches though that output for occurrences of whatever you feed it. This thing of passing one commands output to another is called piping.

    [–] chronicledmonocle@lemmy.world 8 points 20 hours ago (2 children)

    The fuck is a glorp YouTuber?

    [–] luciferofastora@feddit.org 1 points 4 hours ago

    I think they're making fun of not understanding the commands involved?

    [–] FooBarrington@lemmy.world 40 points 20 hours ago* (last edited 18 hours ago) (3 children)

    Glorp is the spiritual successor to Fleeb, though mostly ran by the people behind Pumbu (the ones who started it, not the ones who ran it into the ground) and Muupi (the ones who ran it into the ground).

    [–] funkless_eck@sh.itjust.works 13 points 15 hours ago

    Glorp is on Poob. You can find it on Poob. You can go to Poob and get it. Log onto Poob right now. Go to Poob. Dive into Poob. You can Poob it. It's on Poob. Poob has it for you. Poob has it for you.

    [–] Trail@lemmy.world 6 points 15 hours ago

    It is for when the processes get krangled.

    [–] chronicledmonocle@lemmy.world 4 points 14 hours ago

    I think I developed a brain bleed reading this

    Do you pipe two pipes in times of peace, and two in times of war?

    [–] 9point6@lemmy.world 19 points 22 hours ago (1 children)

    Cat into grep lets you insert something between the file read and grep if you need to without having to reorder anything

    Which is also exactly what said youtuber said in the same video (assuming this is about who I think it is!).

    They also made such reasonable statements as "I also pipe cat into grep when on the command line and playing around with my pipelines, but when it comes to writing full bash scripts to do useful work, think about using grep directly." (not an exact quote btw!)

    [–] exu@feditown.com 15 points 22 hours ago (2 children)

    I prefer | less or less file.txt because I can search interactively

    [–] fartographer@lemmy.world 4 points 13 hours ago

    I prefer less until I find myself using less over and over again until I finally use cat so that I can just scroll up and review whatever I'm looking for.

    Is it the best or right way to do things? Nope, but it gets the job done just as good as anything else I do.

    And, it goes without saying, I do a terrible job of all of it.

    [–] somerandomperson@lemmy.dbzer0.com 10 points 22 hours ago (1 children)

    what about $EDITOR <(cat file)?

    [–] ulterno@programming.dev 6 points 19 hours ago (2 children)

    Well, when I can just do $EDITOR file...

    [–] jayands@lemmy.world 2 points 5 hours ago (1 children)

    The subtle difference is that your $SHELL is responsible for opening (and, iirc, parsing?) the file when you use \<, versus the $EDITOR being the responsible entity.

    [–] ulterno@programming.dev 1 points 49 minutes ago

    Oh I get it now.
    Also, for some reason setting vi as $EDITOR, it is not able to load the contents of the file, unlike vim that does.

    we're talking about a pipeline(-ish) thing here.
    so just out the cmd that you want to read the output of in the brackets

    [–] dabaldeagul@feddit.nl 15 points 22 hours ago* (last edited 16 hours ago) (5 children)

    Ok but what is supposed to be bad about grepping into cat? I don't get it

    Edit: thanks for the replies all, I didn't know you could add a file as an argument in grep. Makes sense now :)

    [–] __hetz@sh.itjust.works 8 points 16 hours ago

    It's less relatable now, and the technology was fucking stupid to begin with, but: Imagine printing out a document and feeding the sheets into a fax machine instead of just sending the file directly to the machine.

    Or using a cassette tape adapter to play music from your phone through a stereo system when that system has a built-in Aux port you could plug directly into ("Useless Use Of Cassette?").

    cat'ing into grep, and a handful of other programs people commonly pipe into from cat, is pointless when grep can be called directly against a file. cat is being run for no reason; a useless use of cat (uuoc). It means fuckall for most people today but I imagine it could've been an actual concern when hardware was much more limited and multiple users were connecting to a single system.

    [–] swicano@programming.dev 16 points 21 hours ago (1 children)

    The video I saw was saying cat into grep is totally fine in day to day life do whatever comes out of your fingertips naturally, but if you're making a bash script for others to use, use grep args because cat pipe grep can do some strange stuff with error handling. Which I have no experience with, but sounds reasonable

    [–] SaharaMaleikuhm@feddit.org 1 points 5 hours ago

    That does sound reasonable. As I will never write such a script for others, I shall continue to cat into grep.

    [–] expr@programming.dev 17 points 21 hours ago* (last edited 21 hours ago)

    cat file.txt | grep foo is unnecessary and a bit less efficient, because you can do grep foo file.txt instead. More generally, using cat into a pipe is less efficient than redirecting the file into stdin with <, like grep foo < file.txt.

    [–] ArsonButCute@lemmy.dbzer0.com 18 points 22 hours ago* (last edited 15 hours ago) (2 children)

    Grep can accept input from stdin as with a piped cat, but I it can also just call the file directly.

    In 99.999% ^obviously^ ^made^ ^up^ ^stat^ ^is^ ^obvious^ of situations its fine.

    The real issue is a piped cat into grep will fork the process. Why open two process threads when one would do the job?

    Edit: it was mentioned by @swicano@programming.dev but to expand a bit: piping cat into grep can also mask quite a few errors. It masks them because of how the shell handles error reporting on piped processes. IIRC, if the file is missing for example, you won't necessarily know that because while cat will throw a not-found error, that gets piped into grep who gladly accepts the error (which was piped to stdin) as its input and greps through the error, reporting back that your content wasn't found in the search material, not that the file was missing.

    [–] CallMeAl@piefed.zip 1 points 2 hours ago

    cat sends its error via stderr so it won't go into the pipe (or grep). you will see the cat error on your terminal, unless you have redirected stderr to stdout

    [–] witty_username@feddit.nl 5 points 20 hours ago

    What the fork is this forking shirt?

    Soz I read your comment as if it were from the good place.

    [–] chrash0@lemmy.world 2 points 22 hours ago

    i think the alternative is to use grep args. but ya know i’m living in the future using nushell’s open command and ripgrep so the argument is just kinda adorable

    [–] Gray_Warden@mander.xyz 10 points 21 hours ago

    I understood a couple of those words. None of the technical ones, but some of them! They were expletives… But I understood them!

    [–] coriza@lemmy.world 3 points 19 hours ago* (last edited 19 hours ago)

    How parsing (as in programming languages and commands) works is so interesting and is so hard for people to grasp and is really interesting to see how what you think is obvious is not for most people. I saw it all the time when teaching cs102. It is so hard to explain the difference that a blank space makes and why sometimes it is necessary and why sometimes it is not.

    That is all to say I find it really interesting and funny when OP says double pipe, because of course it looks like double pipe, you gonna tell me That || is something completely different than a single | ?

    [–] Skullgrid@lemmy.world 1 points 17 hours ago

    just gotta tee