this post was submitted on 01 Jul 2023
1054 points (98.1% liked)

linuxmemes

21179 readers
1751 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 members of the community for any reason.
  • 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.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 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. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.

  • Please report posts and comments that break these rules!

    founded 1 year ago
    MODERATORS
     
    top 50 comments
    sorted by: hot top controversial new old
    [–] not_neno 76 points 1 year ago (5 children)
    [–] Doolbs 10 points 1 year ago (3 children)

    Holy Crap. I have gotten into the arrow up mode. Then I went to History.

    But, but, but ctrl + r. Holy crap.

    Thank you kind sir or madam.

    [–] [email protected] 9 points 1 year ago (1 children)

    If you enjoy that, then let me introduce you you fzf - a fuzzy finder that has support for replacing ctrl + r in shells with fuzzy matching. Among other uses.

    https://github.com/junegunn/fzf#key-bindings-for-command-line

    load more comments (1 replies)
    load more comments (2 replies)
    [–] jrandiny 9 points 1 year ago (2 children)

    You can also install https://github.com/dvorka/hstr to supercharge your ctrl+r

    load more comments (2 replies)
    [–] frank 5 points 1 year ago (2 children)

    Is there a MacOS versión of this? Asking for a friend.

    [–] [email protected] 8 points 1 year ago

    It's the same, ctrl + r. It is a bash/shell thing so works on any os that uses bash or similar shells. Note, it is not the command key, but ctrl, unlike a lot of other shortcuts on macos.

    load more comments (1 replies)
    load more comments (2 replies)
    [–] RomanRoy 41 points 1 year ago (1 children)

    Ctrl R > start typing

    You're welcome to have your life changed

    load more comments (1 replies)
    [–] jg1i 37 points 1 year ago (4 children)
    load more comments (4 replies)
    [–] atx_aquarian 36 points 1 year ago (3 children)

    Y'all know about ctrl-r to search history, right? I went for so many years without even thinking to look for something better than up-arrow, so I have to mention it.

    [–] [email protected] 15 points 1 year ago (8 children)

    Wait until they learn that you can ctrl+u when you mistyped your password in sudo instead of spamming backspace...

    load more comments (8 replies)
    [–] rambaroo 11 points 1 year ago (2 children)

    history | grep

    Does the job well if the key combo doesn't work.

    [–] knobbysideup 6 points 1 year ago

    Followed by !xxx where xxx is the number of the command to re-run

    load more comments (1 replies)
    load more comments (1 replies)
    [–] [email protected] 27 points 1 year ago

    Finally the ls command!

    [–] [email protected] 22 points 1 year ago (2 children)

    Time to up your game with Ctrl + R reverse search! 🤓

    [–] [email protected] 5 points 1 year ago* (last edited 1 year ago) (1 children)

    Oh, and Ctrl + Shift + R brings you back in the search, niiiiice.

    Thank you kind stranger 👍 ☺️.

    load more comments (1 replies)
    load more comments (1 replies)
    [–] [email protected] 19 points 1 year ago (4 children)

    And the command is something like ls -l 👍

    load more comments (4 replies)
    [–] [email protected] 19 points 1 year ago (1 children)

    Up up up up up up up up up oh wait down

    [–] luka 6 points 1 year ago (1 children)
    load more comments (1 replies)
    [–] jcb2016 17 points 1 year ago (1 children)

    ctrl + r then enter phrase

    [–] reblochon 10 points 1 year ago (1 children)
    load more comments (1 replies)
    [–] polite_cat 12 points 1 year ago (2 children)

    Ctrl+R together with fzf makes this obsolete

    [–] meiti 8 points 1 year ago (1 children)

    my humble method: history | grep -i searchterm

    [–] WiseassWolfOfYoitsu 5 points 1 year ago (1 children)

    Then ![historynumber] to execute it

    load more comments (1 replies)
    load more comments (1 replies)
    [–] jogurt 11 points 1 year ago (2 children)

    I usually do ctrl+r but with zsh I can type the beginning of the command and press up and it will search that way too.

    load more comments (2 replies)
    [–] CriticalMiss 11 points 1 year ago (6 children)
    1. vim ~/.inputrc
    2. Paste the following:

    "\e[A": history-search-backward "\e[B": history-search-forward

    Thank me later

    load more comments (6 replies)
    [–] [email protected] 10 points 1 year ago (1 children)

    ~/.bash_history is where my documentation lives

    load more comments (1 replies)
    [–] lhx 10 points 1 year ago

    I feel this in my soul. Or when you realize you're hitting up up up up to find something trivial like ls and it would have been more efficient to just type ls. LOL.

    [–] rln 9 points 1 year ago

    Bro, do you even ^R ?

    [–] zekiz 9 points 1 year ago (3 children)
    load more comments (3 replies)
    [–] Zaros 8 points 1 year ago

    No, no, no. You don't just land on the right one. You accidentally go past it and then have to press down once or twice.

    [–] [email protected] 8 points 1 year ago

    ctrl+p gang RISE UP

    [–] [email protected] 8 points 1 year ago (3 children)

    cat /var/www/vhosts.d/l[tab]o[tab]l[tab]a[tab]...

    load more comments (3 replies)
    [–] [email protected] 8 points 1 year ago (7 children)

    Fish finally broke me of this habit, and now it's one of the first things I install on any system

    load more comments (7 replies)
    [–] corvett 7 points 1 year ago

    history | grep term

    [–] meisme 6 points 1 year ago

    The command is ls

    [–] someacnt_ 6 points 1 year ago (3 children)

    Woah. Quality of meme in this site amazes me.

    load more comments (3 replies)
    [–] NorthWestWind 6 points 1 year ago (2 children)

    I have my zsh set up so that I can type in something and press up to search for commands I ran with the the things I typed

    load more comments (2 replies)
    [–] [email protected] 5 points 1 year ago

    Control+r.

    You're welcome.

    [–] veng 5 points 1 year ago* (last edited 1 year ago) (1 children)

    history | grep {some part of command}

    Much more useful for going further back, even without grep.

    load more comments (1 replies)
    [–] CthulhuDreamer 5 points 1 year ago (1 children)

    Or history | grep {command}

    load more comments (1 replies)
    [–] annoyed_onion 5 points 1 year ago

    I've just signed up to this site and I'm being personally attacked already. smh

    [–] [email protected] 5 points 1 year ago
    load more comments
    view more: next ›