this post was submitted on 25 Aug 2025
1557 points (98.9% liked)

linuxmemes

27042 readers
336 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.
  • 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
     
    you are viewing a single comment's thread
    view the rest of the comments
    [–] theacharnian@lemmy.ca 13 points 6 days ago (5 children)
    [–] bdonvr@thelemmy.club 21 points 6 days ago (1 children)

    CTRL+R [the thing]

    please i beg you

    [–] theacharnian@lemmy.ca 5 points 6 days ago (3 children)

    with grep I see all the alternatives, Ctl+R just shows me one

    [–] oddlyqueer@lemmy.ml 6 points 6 days ago

    For me ctrl-r is faster most of the time, history | grep [command] is better if I can't easily pattern match (don't remember it exactly, using several flag variations, etc.). they're both good tools.

    Combine ctrl+R with fzf and get the best of both worlds

    [–] Evotech@lemmy.world 1 points 6 days ago (1 children)
    [–] iAvicenna@lemmy.world 2 points 6 days ago

    seeing multiple at the same time is more helpful though

    [–] surewhynotlem@lemmy.world 6 points 6 days ago (2 children)

    Ppsshh. Not lazy enough. Create that in a script and call it "hgrep" and drop it into path.

    [–] JoeyJoeJoeJr@lemmy.ml 2 points 6 days ago (1 children)
    [–] surewhynotlem@lemmy.world 1 points 6 days ago

    That's the right way, yes.

    [–] Emerald@lemmy.world 5 points 6 days ago* (last edited 6 days ago) (1 children)

    i was doing cat ~/.bash_history | grep thing which is stupid so i started doing grep "thing" ~/.bash_history

    now you're telling me i should do history | grep thing

    i can't win

    [–] qjkxbmwvz@startrek.website 7 points 6 days ago (1 children)

    Some would call the former command cat abuse.

    In short, unless you want the contents of a file printed to stdout (or multiple files concatenated), the command can probably be written without cat, instead using the filename as an argument (grep pattern file) or IO redirection (cmd < file).

    Stylistics and readability are another thing though.

    [–] Emerald@lemmy.world 2 points 5 days ago

    Some would call the former command cat abuse.

    it 100% is, its just a bad habit of mine

    [–] altphoto@lemmy.today 1 points 6 days ago

    Exactly! Now copy paste it into Joplin where you'll never see it ever again.