1569
siempre lo hago (eviltoast.org)
top 50 comments
sorted by: hot top controversial new old
[-] beerclue@lemmy.world 193 points 2 months ago
[-] serpineslair@lemmy.world 55 points 2 months ago

What the fuck!? How am I only learning this now, after years of linux as daily driver?!

[-] ch00f@lemmy.world 42 points 2 months ago

Shit is usually a pain in the ass. The challenge is divining how much of a pain in the ass something has to be that someone else might have made a solution for it.

I didn't know you could ctrl+shift+c to copy in the terminal until a month ago when my linux n00b wife said "there has to be a better way to do this. I've been right clicking to copy for 10 years.

[-] Neverclear@lemmy.dbzer0.com 26 points 2 months ago

most DE's have a thing where you can paste highlighted text using the middle mouse button

[-] MnemonicBump@lemmy.dbzer0.com 8 points 2 months ago
[-] ArsonButCute@lemmy.dbzer0.com 16 points 2 months ago

Most mouse wheels can be clicked in place of the middle button, which has been removed from most modern computer mouses.

[-] Cethin@lemmy.zip 9 points 2 months ago

It's also known as mouse 3 if you need to find it on your mouse or want to bind it to something else.

[-] TheEighthDoctor@lemmy.zip 8 points 2 months ago

It's also independent from the Clipboard so you can do it while keeping your clipboard

load more comments (2 replies)
[-] Atherel@lemmy.dbzer0.com 22 points 2 months ago

And ctrl + shift + v to paste, just in case

load more comments (1 replies)
load more comments (8 replies)
[-] grrgyle@slrpnk.net 11 points 2 months ago

Congratulations! I remember where I was when I first learned it (in a noisy server room at the back of a machine shop).

Now pair it with FZF for fuzzy finding -- it's surprisingly easy to set up, just following any guide. It's insanely useful. I find myself even doing things like typing:

$ xinput --disable $(xinput --list | grep -i touchpad | grep 'id=[0-9]\+' -o | cut -d= -f2)  # Disable synaptic touchpad trackpad pointer

commands with these like comments on the ends as sort of "tags" so I can ctrl+r search for them later. Yes, I know I could just use a named function, but this is like the step just before that--before I know if I'll be issuing the same command all the time, or just for the next couple weeks. (This one was from when I was resting my notebook on my laptop.)

load more comments (1 replies)
load more comments (5 replies)
[-] Cenzorrll@lemmy.world 12 points 2 months ago* (last edited 2 months ago)

I'm not going to say how long I used linux before learning this. It isn't "this many days old", but it may as well be.

I have 7 headless linux boxes running.

load more comments (2 replies)
[-] Ricaz@lemmy.dbzer0.com 11 points 2 months ago

This but with FZF and ag

[-] lepinkainen@lemmy.world 10 points 2 months ago

https://atuin.sh/ Does all that and a lot more, like showing if the command succeeded and which directory it was run in

[-] Damage@feddit.it 8 points 2 months ago

Even quicker with zsh or atuin: write the first few letters then arrow up to cycle through all matches

[-] Ephera@lemmy.ml 8 points 2 months ago

Even quicker with fish: Write the first few letters then it auto-suggests the last-run command matching that prefix (and then you can still arrow up to cycle through all matches).

(There is also a zsh plugin for that, called zsh-autosuggestions.)

load more comments (3 replies)
load more comments (2 replies)
load more comments (4 replies)
[-] bisby@lemmy.world 94 points 2 months ago
load more comments (5 replies)
[-] bdonvr@thelemmy.club 69 points 2 months ago* (last edited 2 months ago)

I used to be like this but people seriously. CTRL+R

Do it. Don't make this one of those things you've heard about and just never got around to trying. Open your terminal right now and CTRL+R and type any part of the command you did before. If the command you want is not showing first just hit CTRL+R again to go to the next one back.

DO IT.

Edit: I did learn from this thread today though that ZSH has it set to where you can just type part of what you're looking for then hit up to do the same thing. Neat!

[-] Danitos@reddthat.com 19 points 2 months ago* (last edited 2 months ago)

You can empower Ctrl+r event more by using fzf. After I started using it, I can't imagine going back to without it.

[-] harsh3466@lemmy.ml 19 points 2 months ago* (last edited 2 months ago)

Holy shit. I just tried it. ctrl+r is a revelation! How the fuck did I not know about this?

[-] AkatsukiLevi@lemmy.world 18 points 2 months ago

WHAT THE FUCJ IS THIS SORCERY BRO I'VE BEEN USING LINUX FOR AGES AND NEVER KNEW THIS BROOOOOOOOOO

[-] lepinkainen@lemmy.world 13 points 2 months ago

If you want to level up ctrl-r, upgrade to Atuin: https://atuin.sh/

[-] The_Decryptor@aussie.zone 8 points 2 months ago

Edit: I did learn from this thread today though that ZSH has it set to where you can just type part of what you’re looking for then hit up to do the same thing. Neat!

Fish too, it's fantastic.

load more comments (2 replies)
[-] Evotech@lemmy.world 66 points 2 months ago
load more comments (4 replies)
[-] KiwiTB@lemmy.world 40 points 2 months ago

What, and type 'ls' again?

[-] PhAzE@lemmy.ca 28 points 2 months ago* (last edited 2 months ago)

Ctrl + R and start typing the command, it'll come up, press enter. Im just more lazy because I know there are still faster ways.

Edit: instead of hitting enter, keep pressing ctrl + R to cycle through history commands that contain what you typed in

load more comments (2 replies)
[-] BigDanishGuy@sh.itjust.works 21 points 2 months ago

More like ⬆️⬆️⬆️⬆️⬆️⬆️ mother fucker ⬇️

load more comments (1 replies)
[-] muzzle@lemmy.zip 19 points 2 months ago
load more comments (1 replies)
[-] Semi_Hemi_Demigod@lemmy.world 17 points 2 months ago

history | grep ‘part of the command I remember’

[-] FuyuhikoDate@feddit.org 8 points 2 months ago

Ha... That as if I would ever remember the part of the tool instead of the fact what it did 🤣

[-] palordrolap@fedia.io 7 points 2 months ago

Also: Ctrl+r then type the part of the command you remember.

load more comments (1 replies)
[-] theacharnian@lemmy.ca 14 points 2 months ago
[-] bdonvr@thelemmy.club 21 points 2 months ago

CTRL+R [the thing]

please i beg you

load more comments (5 replies)
load more comments (7 replies)
[-] djvinniev77@lemmy.ca 13 points 2 months ago
load more comments (6 replies)
[-] iAvicenna@lemmy.world 13 points 2 months ago

history | grep then !cmd_number

[-] rumba@lemmy.zip 11 points 2 months ago

!ssh

run the last command that started with ssh

load more comments (2 replies)
[-] JATtho@lemmy.world 11 points 2 months ago

zsh-history-substring-search

I lazily type part of the thing I want like "sys" and then ctrl+⬆️/⬇️ and sudo systemctl start libvirtd etc. appear like magic.

[-] rumba@lemmy.zip 11 points 2 months ago

You're in vim, you forgot to sudo, the file is read only and you have loads of changed you don't feel like saving off to /tmp and playing the copy file shell game.

[esc]:w !sudo tee %

it shoves the current buffer through tee (termina adapter) with sudo privs vim will warn you that the file changed, just [esc]:q! and don't let it save, you already saved it.

load more comments (2 replies)
[-] highball@lemmy.world 10 points 2 months ago
load more comments (2 replies)
[-] ___f____g___@lemmy.ca 9 points 2 months ago* (last edited 2 months ago)

I see everyone posting about Ctrl+R, here's a couple more useful CLI shortcuts you might enjoy:

cd - (change directory to $OLDPWD usually the previous directory)

git checkout - (similarly checkout the previous branch)

Ctrl+A (return caret to beginning of command, great when you forgot a positional argument and you were almost done typing the command)

Ctrl+E (similar to Ctrl+A but move to the end of the command)

load more comments (1 replies)
[-] cm0002@piefed.world 8 points 2 months ago

Report post

Report reason: ⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️"There it is" I'm in this picture and I don't like it

[-] Dave@lemmy.nz 8 points 2 months ago

Everyone sharing their Ctrl+R tips, here's my Control+R question:

How does scope work? Some command history only seems to exist in certain tabs.

Also sometimes I Ctrl+R in a tab then the command is there but I forget I need a different one first, so I ctrl+c but the next time I search for that original command somehow it doesn't exist anymore.

I'm using the default terminal on Nobara (fedora based).

[-] Trail@lemmy.world 12 points 2 months ago

As far as I remember, there is a bash setting that controls whether the command history is written immediately after execution (in which case it is immediately available on all tabs/windows of the console) or after closing the session (in which case it will be available next time/potentially lost if the window is forcibly closed etc).

The default is the second one as far as I remember.

That said, I had changed to a more powerful one in zsh years ago, so it's been a while...

load more comments (1 replies)
[-] PotatoesFall@discuss.tchncs.de 9 points 2 months ago* (last edited 2 months ago)

This actually doesn't depend on your terminal but on the shell running inside it. Bash is the default on most distros. I have also frequently had this issue. There might be config to fix it.

I switched to fish instead of bash, and now I use fzf and the https://github.com/PatrickF1/fzf.fish plugin and it works GREAT. There might be a similar thing for bash, I don't know.

load more comments (1 replies)
[-] Zink@programming.dev 8 points 2 months ago* (last edited 2 months ago)

Ah crap how did I set my battery charge interval again?

history | grep battery

history | grep bios

history | grep sudo smbios

Ah! There you are you little shit!

edit to add: Actually, I think the last time I did this I remembered some numbers I set it to before. So it worked well with something like "history | grep 75" even though there were a bunch of results.

load more comments (2 replies)
[-] onebonestone@lemmy.world 8 points 2 months ago

Or just use fish shell. Rarely need ctrl+r anymore.

load more comments (3 replies)
load more comments
view more: next ›
this post was submitted on 25 Aug 2025
1569 points (100.0% liked)

linuxmemes

27928 readers
1022 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