this post was submitted on 30 Apr 2025
793 points (97.6% liked)

linuxmemes

24701 readers
2651 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
     

    I thought it'd be a pain but installing programs through the terminal is actually so nice, I never would have expected it

    you are viewing a single comment's thread
    view the rest of the comments
    [–] kibiz0r@midwest.social 74 points 13 hours ago (5 children)
    • tab completion works in more places than you might expect
    • ctrl-a/ctrl-e for start/end of line
    • ctrl-u to clear the command you’ve typed so far but store it into a temporary pastebuffer
    • ctrl-y to paste the ctrl-u’d command
    • ctrl-w to delete by word (I prefer binding to alt-backspace though)
    • ctrl-r to search your command history
    • alt-b/alt-f to move cursor back/forwards by word
    • !! is shorthand for the previous run command; handy for sudo !!
    • !$ is the last argument of the previous command; useful more often than you’d think
    • which foo tells you where the foo program is located
    • ls -la
    • cd without any args takes you to your home dir
    • cd - takes you to your previous dir
    • ~ is a shorthand for your home dir
    [–] ayyy@sh.itjust.works 2 points 2 hours ago

    If you’re looking for a full list of these kind of navigation shortcuts, they all come from readline so read the man page for that. Or just look up the basic navigation of emacs which is what readline is mimicking.

    [–] Dumhuvud@programming.dev 3 points 9 hours ago

    Nice list, TIL about Ctrl+U and Ctrl+Y.

    If I may add, Ctrl+X into Ctrl+E opens $EDITOR to edit the current line.

    [–] exocortex@discuss.tchncs.de 7 points 12 hours ago* (last edited 12 hours ago)

    I've been using the commandline for so long but was always too lazy to look up the rest of these commands after ctrl+a/e and ctrl+r THANK YOU!!!

    post this commend again and again! There's always lazy idiots like me who will be helped that way!

    [–] myotheraccount@lemmy.world 6 points 11 hours ago
    • alt-. also pastes the last argument of the previous command (useful if you need to modify it a bit)
    • instead of any shortcuts starting with "alt" you can also press "esc" followed by the second key, e.g. pressing "esc", releasing it and then "a" is the same as pressing "alt-a" (useful if you have only one hand available, or if alt is not availalble)
    • if you put a space before a command, it will not be saved in history (useful sometimes, e.g. if you pass a password directly as an argument)
    [–] apelsin12@lemm.ee 5 points 12 hours ago (1 children)

    Makes me realize just how illogical and bad these shortcuts are

    [–] Dumhuvud@programming.dev 6 points 9 hours ago (2 children)

    I believe, these are Emacs shortcuts. There's also set -o vi in bash, but I've never used it, so can't vouch for it.

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

    That’s good to know. It’s interesting that the other commenter thinks emacs shortcuts are illogical. I’ll make my best guesses at the logic

    • ctrl-a/ctrl-e for start/end of line

    a is the beginning of the alphabet; e for end (of line)

    • ctrl-u to clear the command you’ve typed so far but store it into a temporary pastebuffer
    • ctrl-y to paste the ctrl-u’d command

    No idea here. Seems similar to nano with k-“cut” and u-”uncut”.

    • ctrl-w to delete by word

    w for word obviously.

    • ctrl-r to search your command history
    • alt-b/alt-f to move cursor back/forwards by word

    r reverse, b back, f forward. Not sure why alt vs control though; presumably ctrl+b and ctrl+f do different things although I know emacs likes to use Alt (“Meta”) a lot.

    [–] medicsofanarchy@lemmy.world 2 points 2 hours ago

    In the 1980s, Digital Equipment Corporation had a word processor, WPS. Ctrl-u cleared the line you were typing and put it into the paste buffer. Maybe legacy usage?

    [–] apelsin12@lemm.ee 2 points 8 hours ago

    Explains why they are so illogical! Unfortunately i think its better to just learn the defaults since i remote into lots of servers where i dont carry my config