this post was submitted on 13 Dec 2025
435 points (97.0% liked)

linuxmemes

28434 readers
2572 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
    you are viewing a single comment's thread
    view the rest of the comments
    [–] Multiplexer@discuss.tchncs.de 66 points 1 day ago (5 children)

    interesting, didn't know that... Will try!

    Finding out about "Ctrl-r" also was a gamechanger.

    [–] Sibbo@sopuli.xyz 31 points 1 day ago (1 children)
    [–] Multiplexer@discuss.tchncs.de 54 points 1 day ago* (last edited 1 day ago) (4 children)

    Lets you easily and interactively search your command history.
    Half the stuff I do is usually preceded by that, it's really useful!

    [–] JustJack23@slrpnk.net 99 points 1 day ago (2 children)

    Oh that is nice, I usually use ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    [–] mech@feddit.org 8 points 1 day ago

    "I knew I had an ls somewhere in my history"

    [–] ClownStatue@piefed.social 9 points 1 day ago

    That’s part of the natural progression. Can’t remember if that comes before or after β€œhistory | grew command.”

    [–] chtk@sh.itjust.works 19 points 1 day ago (1 children)

    Adding fzf to the mix makes Ctrl+r even better.

    [–] groet@feddit.org 7 points 1 day ago

    Yeah standard bash Ctrl+r is just so painful. I much rather use "history | grep searchtearm" than that awfull search. fzf is a whole other level. But nowadays I just use fish shell which IMO has even better search than fzf

    [–] 69420@lemmy.world 6 points 1 day ago (1 children)

    Just wait until you discover fish/zsh autosuggestions.

    [–] turbowafflz@lemmy.world 2 points 1 day ago

    As annoying as using a non-posix compatible shell sometimes is, fish saves me so much time

    [–] ulterno@programming.dev 0 points 1 day ago

    I have been suggested alternative programs to install to work with Ctrl+r, which are supposed to work better, but I just end up using kwrite ~/.bash_history when Ctrl+r fails.

    [–] farcaller@fstab.sh 15 points 1 day ago (2 children)
    [–] Maestro@fedia.io 2 points 1 day ago
    [–] naeap@sopuli.xyz 1 points 1 day ago

    Thanks!
    Haven't heard that one before. Comes on my growing list of all the stuff I wanna try/setup...

    [–] neidu3@sh.itjust.works 7 points 1 day ago (3 children)

    I accidentally stumbled across Ctrl+r over a decade ago and I still don't understand properly how it works. So I usually egrep -e someInsaneRegex ~/.bash_history

    [–] eah@programming.dev 3 points 1 day ago

    The part of the tech stack that handles all these command editing and navigation shortcuts is the readline library. Check out man readline. There's an entire section on searching. readline is used for lots of other interpreters, too.

    [–] FishFace@piefed.social 2 points 1 day ago

    That is worth it for more complicated things like, "I want all commands that started with git and contained 'foo'"

    [–] Multiplexer@discuss.tchncs.de 2 points 1 day ago (1 children)

    Did it like that before, but Ctrl-r is typically just a lot faster.

    [–] Prunebutt@slrpnk.net 7 points 1 day ago* (last edited 1 day ago)

    If you install a fuzzyfinder, like fzf, or skim, you get previews of the search query result and fuzzy search, which is really cool, too.

    [–] SeductiveTortoise@piefed.social 3 points 1 day ago* (last edited 1 day ago) (1 children)

    Ctrl+r is cool, but atuin is oh my gosh great

    https://atuin.sh/

    [–] tetris11@feddit.uk 3 points 1 day ago (2 children)

    isn't that just fzf with ctrl-R binding

    [–] crater2150@feddit.org 4 points 23 hours ago

    I used fzf before atuin, and it works pretty similar, but atuin has a few additional features, as it tracks more information than the normal shell history. For example, you can also search only for commands that you executed in the current directory (great for stuff that is project specific). Or, if you use the history syncing feature, you can toggle search for commands you executed on either any or only the current machine.

    I didn't know fzf yet. Neat

    [–] alias_qr_rainmaker@lemmy.world 3 points 1 day ago* (last edited 1 day ago) (1 children)

    dude holy shit that is AWESOME! i had something similar, but it was a custom function.

    srch() { cat ~/.bash_history | grep -Ein "$@"}

    [–] korthrun@lemmy.sdf.org 3 points 1 day ago* (last edited 1 day ago) (1 children)

    Did you know that grep can take the name of the file(s) you want it to search as the final arguments?

    For example: grep -Ein "$@" ~/.bash_history

    i always pipe into grep so sometimes i forget that's even an option, lol