this post was submitted on 24 Sep 2025
199 points (98.5% liked)

Programmer Humor

38482 readers
401 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
top 27 comments
sorted by: hot top controversial new old
[–] PanArab@lemmy.ml 20 points 4 days ago (1 children)
[–] Fossifoo@hexbear.net 2 points 3 days ago

Or if you are not sure what it was at all: history

[–] HumanPerson@sh.itjust.works 9 points 3 days ago

You forgot a couple down arrows for when you overshoot.

[–] ramius345@sh.itjust.works 18 points 4 days ago (1 children)
[–] calliope@retrolemmy.com 2 points 4 days ago* (last edited 4 days ago)

Or sometimes history if I can’t remember at all.

Oh my bad, two other people said that too I was just excited

[–] HiddenLayer555@lemmy.ml 5 points 3 days ago* (last edited 3 days ago)

The command you want is in the buffered history of a still running terminal that's doing something you don't want to close 💀

[–] Moonrise2473@lemmy.ml 5 points 3 days ago (2 children)

Introducing: fish

And then you just need to remember the first letters of the previously typed command

[–] yogthos@lemmy.ml 3 points 3 days ago

Yup, I started using fish a while back and autocomplete is what kept me on it. The best part is that it's contextual based on the folder you're in.

[–] barubary@infosec.exchange 3 points 3 days ago

Look up history-search-backward in your favorite bash/readline manual.

[–] foster@lemmy.hangdaan.com 10 points 4 days ago

It's either this or history | grep 'some-command'.

[–] roux@hexbear.net 9 points 4 days ago (2 children)

Me with git pushes: up up up, enter x3. Like 6 times a day.

[–] yogthos@lemmy.ml 8 points 4 days ago (2 children)
[–] roux@hexbear.net 11 points 4 days ago (1 children)

Not me using Linux for 15 years and just learning you can search through previous commands...

[–] isame@hexbear.net 2 points 4 days ago (1 children)

I hope I'm not blowing your mind when I tell you that you can grep .bash_history?

[–] roux@hexbear.net 2 points 4 days ago

Easy there wizard. In my defense I don't hang out in a terminal all that much anymore.

[–] Jolteon@lemmy.zip 1 points 3 days ago

With only three up presses, it would probably be faster than ctrl+r

[–] naevaTheRat@lemmy.dbzer0.com 1 points 3 days ago

Just make some aliases and scripts you lunatic.

[–] nathan@piefed.alphapuggle.dev 9 points 4 days ago* (last edited 4 days ago)

history

!982

[–] naevaTheRat@lemmy.dbzer0.com 4 points 3 days ago

Some of you haven't read the bash manual and it shows.

Blow your mind to know about bang patterns. You've used !! but do you know about !$?

[–] lugal@lemmy.dbzer0.com 7 points 4 days ago
[–] krash@lemmy.ml 3 points 3 days ago

If you haven't, try McFly - is a much better backwards / history search in the shell.

[–] KrasMazov@lemmygrad.ml 5 points 4 days ago

Don't call me out like that lol. Also Atuin is pretty cool for this as you are showed a list of the commands used when you press ⬆️.

[–] highduc@lemmy.ml 6 points 4 days ago

If you're in this picture try using fzf and backwards search, much more effective, hell even without fzf.

[–] Rom@hexbear.net 5 points 4 days ago

Why would I type out this command that's six whole keystrokes long when I can save time by pressing 'up' twenty times instead?

[–] Diurnambu1e@hexbear.net 2 points 3 days ago

After a time ypu look into extending the history too... 500line by default is far too short for all the awesome commands

[–] scottmeme@sh.itjust.works 4 points 4 days ago (1 children)