207
Linux Users (lemmy.ml)
submitted 3 months ago by yogthos@lemmy.ml to c/programmerhumor@lemmy.ml
all 27 comments
sorted by: hot top controversial new old
[-] PanArab@lemmy.ml 22 points 3 months ago
[-] Fossifoo@hexbear.net 4 points 3 months ago

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

[-] ramius345@sh.itjust.works 19 points 3 months ago
[-] calliope@retrolemmy.com 3 points 3 months ago* (last edited 3 months ago)

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

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

[-] foster@lemmy.hangdaan.com 11 points 3 months ago

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

[-] roux@hexbear.net 10 points 3 months ago

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

[-] yogthos@lemmy.ml 9 points 3 months ago
[-] roux@hexbear.net 12 points 3 months ago

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

[-] isame@hexbear.net 3 points 3 months ago

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

[-] roux@hexbear.net 3 points 3 months ago

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

[-] naevaTheRat@lemmy.dbzer0.com 2 points 3 months ago

Just make some aliases and scripts you lunatic.

[-] HumanPerson@sh.itjust.works 9 points 3 months ago

You forgot a couple down arrows for when you overshoot.

[-] nathan@piefed.alphapuggle.dev 9 points 3 months ago* (last edited 3 months ago)

history

!982

[-] lugal@lemmy.dbzer0.com 8 points 3 months ago
[-] Rom@hexbear.net 7 points 3 months 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?

[-] highduc@lemmy.ml 7 points 3 months ago

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

[-] HiddenLayer555@lemmy.ml 6 points 3 months ago* (last edited 3 months 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 πŸ’€

[-] naevaTheRat@lemmy.dbzer0.com 6 points 3 months 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 !$?

[-] KrasMazov@lemmygrad.ml 6 points 3 months 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 ⬆️.

[-] Moonrise2473@lemmy.ml 5 points 3 months ago

Introducing: fish

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

[-] yogthos@lemmy.ml 4 points 3 months 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 months ago

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

[-] krash@lemmy.ml 4 points 3 months ago

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

[-] scottmeme@sh.itjust.works 4 points 3 months ago
[-] Diurnambu1e@hexbear.net 3 points 3 months ago

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

this post was submitted on 24 Sep 2025
207 points (98.6% liked)

Programmer Humor

39675 readers
56 users here now

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

Rules:

founded 6 years ago
MODERATORS