this post was submitted on 21 May 2025
501 points (99.0% liked)

linuxmemes

25025 readers
1393 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
    [–] Lazycog@sopuli.xyz 23 points 1 day ago (3 children)

    This is why I follow linux memes, I don't know if I have ever bumped into CTRL+R but I finally can let go of

    history
    
    [–] tal@lemmy.today 18 points 1 day ago* (last edited 1 day ago) (1 children)

    If you haven't used them before, there's also ! and ^.

    ! invokes the last command starting with the following string.

    ^ searches for the last command containing the first string, replaces that string with the second, and invokes that.

    $ ls *.mp4
    Episode_One.mp4  Episode_Two.mp4
    $ !l
    ls *.mp4
    Episode_One.mp4  Episode_Two.mp4
    $ ^mp4^mp3
    ls *.mp3
    music.mp3
    $
    [–] Lazycog@sopuli.xyz 5 points 1 day ago

    I used !<index> Together with history by giving an index displayed in the history list, but did not know that you can use it like that! Also didn't know about ^

    Thanks for the tips!

    [–] palordrolap@fedia.io 2 points 1 day ago (1 children)

    You say this, but then you discover $HISTTIMEFORMAT which helps records when you last ran a command as a comment in the history file and Ctrl+R won't tell you that information.

    The hard part with adopting that, though, is editing in plausible looking dates for commands that were issued before it was set up (or choosing not to and dealing with the confusion until those commands disappear off the top of the history).

    [–] Lazycog@sopuli.xyz 1 points 1 day ago

    Another awesome tip I've learned today, thanks! Yeah often I remember the actual day I typed a specific command but must manually scroll through. This is another useful tip. I don't think I'll completely let go of history since it's also super convenient to just look up index and type !345 for example.

    [–] nesc@lemmy.cafe 5 points 1 day ago (2 children)

    While you are at it, look up readline shortcuts.

    [–] tal@lemmy.today 8 points 1 day ago* (last edited 1 day ago) (1 children)

    The default ones are the same as in emacs, so if you know emacs, you probably know them too, but Control-U kills (roughly equivalent to "cut" for non-emacs people) from the cursor to the beginning of the line, which emacs doesn't do; that defaults to something like M-- M-1 C-k in emacs.

    If you're a vi person, you can do set -o vi and use vi functionality. Hit Esc to go into vi-style command mode.

    [–] nesc@lemmy.cafe 3 points 1 day ago (1 children)

    In emacs it would be C-u - C-k I think.

    [–] tal@lemmy.today 2 points 1 day ago (1 children)

    That'd be equivalent. Emacs has a number of way to input arguments to functions.

    [–] nesc@lemmy.cafe 2 points 1 day ago

    True, I forgot that it's possible to pass argument with M-#. 😺

    [–] Lazycog@sopuli.xyz 1 points 1 day ago

    I feel like I forget those that I just don't use often enough, and when I would need them I default to what I know (which is always a slower way than knowing a shortcut) in a "hurry".

    Guess I should just print them and tape the paper next to my monitor.