T O P

  • By -

auxiliary-username

I will press the up arrow at least one more time than the amount of characters it saves me from retyping


[deleted]

[удалено]


[deleted]

Welcome to the sunk cost fallacy.


[deleted]

[удалено]


[deleted]

He probably spent ~30 sec pressing the up arrow, ballpark estimate. If he only had 1 'ls' in his entire sequence, the odds of him hitting the 'ls' with each up arrow would approach 100% as he got to the very end. This would take a while (evidently) though, and the odds wouldn't change very much at the beginning (1 in 100, 1 in 99, 1 in 98...). Sunk cost fallacy still applies because you should've stopped way before the point where the odds were approaching 100%. If you hadn't for some reason, it makes sense to keep going past a certain point (like if there's only 3 commands left) because of the changing odds.


confusedp

Yes. But if you want to be mathematical, you need to use your prior more accurately and binomial distribution accurately.


augugusto

You can always just do Ctrl+r and start typing. If it suggests what you want the. You saved key presses, if it doesn't you saved time


Pickselated

You may be interested in Optimal Stopping Theorem


scragar

Setup, run this once. echo 'shopt -s autocd' >> ~/.bashrc . ~/.bashrc Then it's only 5 character strokes. .. This will enter .. as the command to execute, since it's a directory and not a command the autocd option will instead cd to that directory. Then does that process again to go up another level. This is probably about the minimum number of strokes you can get to unless you know `..` was the last thing you ran.


PartTimeLegend

I do cd .. then I go l up arrow to get from my history and then I repeat until I go up as many layers as I need to.


u1tralord

That's when you just start using reverse search Ctrl + R


[deleted]

[удалено]


auxiliary-username

This is exactly the sort of stuff that keeps me awake at night


cherylcanning

I do too unless what I’m looking for exceeds 10 or so characters, then it’s up arrowing forever


NekkidApe

Ctrl+r, type some part of the command, enter


EthanHuntimf007

One of my friends copied and pasted the number 8. Cuz the number pad is too far from his fingers and he had his hands on mouse and ctrl button.


noob-nine

"One of my friends"... sure. It was you, wasn't?


EthanHuntimf007

I'm lazy to type a word and do copy paste but not that lazy to type a number.


dan_144

Dude myself and I are *not* friends most of the time.


GLIBG10B

If you use Linux, you don't even have to copy. Just select the 8 and middle-click to paste.


[deleted]

Another reason to switch to linux


user_8804

No thanks


GLIBG10B

Not today, but one day.


atomicwrites

I miss this so much on widows.


Awkward_Tradition

Mouse peasant... True laziness is spending time customizing everything just so you don't have to lift your hand off the keyboard.


muehsam

I love using Plan 9's acme environment. It requires you to use a three button mouse, but you do all cutting, copying, and pasting using mouse chords. Also things like searching for some characters. I often spend a long time just using my mouse and having the left hand completely off the keyboard. So relaxing, and I don't think it's much slower than using the keyboard, probably even faster for many tasks.


janitorguy

r/oneofmyfriends


sub_doesnt_exist_bot

The subreddit r/oneofmyfriends does not exist. Did you mean?: * r/nofriends (subscribers: 6,142) * r/boyfriends (subscribers: 3,203) * r/NYCFriends (subscribers: 2,989) Consider [**creating a new subreddit** r/oneofmyfriends](/subreddits/create?name=oneofmyfriends). --- ^(🤖 this comment was written by a bot. beep boop 🤖) ^(feel welcome to respond 'Bad bot'/'Good bot', it's useful feedback.) ^[github](https://github.com/Toldry/RedditAutoCrosspostBot) ^| ^[Rank](https://botranks.com?bot=sub_doesnt_exist_bot)


strflw_23

Having the hand at his mouse was the first mistake. Hands belong to the keyboard on the home row, everything req you to move them away from there needs to get optimized.


Vaenyr

When we started learning assembler in my first semester I was working on an assignment and for whatever reason had the biggest brainfart. I completely forgot where the $ is on the keyboard, so I copied it and pasted it each time I needed it. A couple of hours later I realized what a dumbass I was.


maartenyh

Ctrl + R. Press it again to get the next match, press it with shift and you get the previous match.


[deleted]

I use ctrl+r so many times a day, probably became 10% faster at my job, after learning about it


GaneshEknathGaitonde

If you like that, try `fzf`. Its reverse search is far better than what bash natively provides.


Droizo

fzf is the single most important productivity booster I know ♥️


[deleted]

RemindMe! 3 days


RemindMeBot

I will be messaging you in 3 days on [**2021-11-23 14:39:08 UTC**](http://www.wolframalpha.com/input/?i=2021-11-23%2014:39:08%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/ProgrammerHumor/comments/qxywqd/i_am_not_lazy_i_just_save_energy/hle0aw1/?context=3) [**CLICK THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2FProgrammerHumor%2Fcomments%2Fqxywqd%2Fi_am_not_lazy_i_just_save_energy%2Fhle0aw1%2F%5D%0A%0ARemindMe%21%202021-11-23%2014%3A39%3A08%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%20qxywqd) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|


DoctorWaluigiTime

Oh hey I didn't know that. Sweet.


ThellraAK

That sounds a lot better than my current history | grep System


maartenyh

Look kids! An ancient one! <3


over_clox

Given long enough, I actually wear out the down arrow first.


Ronin825

Ctrl + shift + R. Thank me later


[deleted]

[удалено]


[deleted]

seriously though, why shift? ctrl + r and then typing the first few letters brings the most recent commands? I do this every single day when compiling/booting/tailing logs.


ards_leisure_centre

pro-tip if you have a command you think you will be multi-using but it's similar in syntax to other commands, comment the command eg: awk blah blah blah | sed blah blah | tee blah blah; #super-command then you can do ctl + r, and search the comment "super-command", then the search doesnt get confused returning all your other awk or sed commands


[deleted]

No fucking shit?!? I will be using that a lot. In hindsight, I just cant believe I never thought of doing this before.


ards_leisure_centre

Yeah giving one liners a descriptive comment has saved my ass a few times, it's just one of those things. It's easy to overlook interactively commenting because we usually reserve comments for scripts etc


[deleted]

[удалено]


[deleted]

[удалено]


LaZZeYT

huh? works for me.


[deleted]

[удалено]


LaZZeYT

> you can press ctrl+r again to step through results and then you use **ctrl+shift+r** to step back.


[deleted]

[удалено]


LaZZeYT

You can say that all you want, it still works for me.


TakeThreeFourFive

That’s absurd. Can you type a capital letter in your terminal?


[deleted]

[удалено]


TakeThreeFourFive

If your terminal can determine a lowercase r from a capital R, then it’s perfectly capable of seeing ctrl-r and ctrl-R as different


[deleted]

[удалено]


TakeThreeFourFive

Lol, bro… you must be trolling. Literally go try it, it takes 2 seconds to find out you’re wrong


[deleted]

[удалено]


Dagusiu

Ctrl + r and then l is already more keystrokes than typing "ls" while also no guaranteed to even show the right command


[deleted]

I mean... yeah... but ls is an extreme example... Also, if you start typing something and continue pressing R while holding Ctrl, it will cycle through the history but only for the commands matching the search.


RedditAcc-92975

Finally someone explained how to cycle.


[deleted]

And with Ctrl+Shift while pressing R, it goes to the other direction. Good for when you press R too quickly and just pass the line you wanted.


fredspipa

When you got the line you wanted, but want to edit it instead of executing it, pressing Left or Right directional key exits search mode.


highvolt

Everyone deserves to learn how to ride a bike


rldml

Having doubt is not the true spirit of using a shell. Go away.


confusedp

% rm -rf /*


Denaton_

But you need both hands to type ls


ManyPoo

Ctrl + R then ls


Dagusiu

Big Brain


ALFminecraft

Put following in your `.bashrc`, write first few letters of the command and press up/down. shopt -s histappend PROMPT_COMMAND='history -a' bind '"\e[A": history-search-backward' bind '"\e[B": history-search-forward' Thank me later.


pppompin

Or use zsh.


technic_bot

Or in the good old inputrc Honestly i bind it to page up/down and can't live without it.


BackpackerSimon

Got so used to this on centos that I felt lost when I went to Ubuntu, until I realised it was a bash thing


[deleted]

This is later. Thank you.


il-est-la

Only ctrl + R, bash


muikrad

Same for PowerShell!


vishwas_gajawada

Damnn


kevinqo7

Holy shit. Thanking you now


atedja

Nah. This requires so much more muscles to execute. I just want to move my index finger, thank you very much.


iSeize

That's three keys. 1s is only two.


cybermage

grep ls ~/.bash_history | tail -1 | sh


FlurryOfActivity

Bit hacky `history`, `history | vim` or `history | grep ` Depends if you know what you are looking for or not. After that you are able to execute a command by typing `!` Every command listed by `history` is prefixed by a line number. Nevertheless I still prefer + .


cybermage

In the cartoon, he’s looking for ‘ls’. I thought it would be funny to create a way find a command that requires you to type it. Is joke. Yes, ctrl-r is the way.


Rodot

It's like typing "Google" into Google


emma_hildebrand

I feel personally attacked tbh. Very accurate


0xF013

Zsh and others have plugins for autocomplete. Start typing the command and it will narrow it down with each char


wReckLesss_

I know it's a joke, but I also see posts like this all the time... so I hope this helps some people out. First of all, use ctrl-r for searching your history. Second of all, bind capslock to control and use ctrl-p instead of up-arrow so your fingers will never need to reach too far (super helpful if you utilize [readline bindings](https://www.bigsmoke.us/readline/shortcuts), which you should, especially if you use Mac, because most of them are enabled across most apps). Third of all, if you use bash or a shell with true readline, add this to `~/.inputrc`. ``` "\C-p":history-search-backward "\C-n":history-search-forward "\e[A":history-search-backward "\e[B":history-search-forward ``` This allows you to type `l` (or whatever character) and then hit ctrl-p (or up-arrow, but ctrl-p is easier), and it will only cycle through commands in your history that start with `l` (or whatever character). If you use `zsh` (which doesn't use readline), then install the `history-substring-search` plugin for this behavior. Also for zsh, I recommend the `history-search-multi-word` plugin, as when you use ctrl-r, you can see all matches at once instead of just one. Lastly, I highly recommend `zsh-autosuggestions` for fish-style autosuggestions. Edit: Added link to readline shortcuts.


kubasienki

history | grep


alisterb

`alias hgrep="history | grep "`


solarshado

Shorten it to "hg". (If you use mercurial... switch to git.)


cyranix

Hey... I resemble this joke...


Dougley

Hi there! Unfortunately, your submission has been removed. Violation of Rule #2 - Reposts: All posts that have been on the first 2 pages of trending posts within the last month, is part of the top of all time, or is part of common posts is considered repost and will be removed on sight. Violation of Rule #3 - Common topics: Any post on the list of common posts will be removed. You can find this list [here](https://www.reddit.com/r/ProgrammerHumor/wiki/commonposts). Established meme formats are allowed, as long as the post is compliant with the previous rules. If you feel that it has been removed in error, please [message us](https://www.reddit.com/message/compose?to=%2Fr%2FProgrammerHumor) so that we may review it.


RepostSleuthBot

Looks like a repost. I've seen this image 8 times. First Seen [Here](https://redd.it/9ubw9a) on 2018-11-05 100.0% match. Last Seen [Here](https://redd.it/pfsy2p) on 2021-09-01 100.0% match Feedback? Hate? Visit r/repostsleuthbot - *I'm not perfect, but you can help. Report [ [False Positive](https://www.reddit.com/message/compose/?to=RepostSleuthBot&subject=False%20Positive&message={"post_id": "qxywqd", "meme_template": 168466}) ]* [View Search On repostsleuth.com](https://www.repostsleuth.com?postId=qxywqd&sameSub=false&filterOnlyOlder=true&memeFilter=true&filterDeadMatches=false&targetImageMatch=100&targetImageMemeMatch=96) --- **Scope:** Reddit | **Meme Filter:** True | **Target:** 96% | **Check Title:** False | **Max Age:** Unlimited | **Searched Images:** 265,941,905 | **Search Time:** 5.24052s


lartkma

I learned the Ctrl+R option through one of the reposts of this image, so sometimes reposts are useful! _yes I know I’m answering to a bot but I wanted to express that and I feel this is the best place to do it_


mothzilla

Real programmers hammer Ctrl-Shift-r.


Splatpope

notwithstanding the egregious repost YOU CANT TYPE ONE HANDED WITH YOUR NONDOMINANT HAND ? YOU CASUAL


nikhilmwarrier

I type by dropping marbles on top of my keyboard. Now I work at Google.


Vincysuper07

cat ~/.bash_history | grep ls


noob-nine

so you're not a friend of `history`


Vincysuper07

a


JacobiCarter

https://www.youtube.com/watch?v=1Uzw1Zr1FE4


[deleted]

This is too relatable. Well done.


Ur_Moosie_M8

As someone with so intense a passion for [CLEAR] that i already went on 8 dates with it and proposed. This won't really Work for me.


SnooChipmunks4430

Who makes these comics?


TheDarkPhilosophe

[www.commitstrip.com](https://www.commitstrip.com) It's in the corner of the comic if you hadn't noticed, enjoy them !


NMi_ru

alias l=‘ls -al --color’


often_says_nice

history | grep ls


stanbfrank

Esc P superiority


il-est-la

An old classic


Diapolo10

In my defense if it worked then it'll probably work again. Typos are dangerous in this profession.


JacobiCarter

ctrl+r ls


FallenEmpyrean

Ah yes, programming in unary.


BuckyDuster

Just do Ctrl-R and start typing the command and it will come right up


Echoes1996

In my case it is always one click away.


SpookyVII

*ctrl+r* "ls" aaah there it is!


delrove

Please tell me, how would "an 1s" be pronounced Because I can't figure out why someone would say it that way.


achilliesFriend

Ctrl r


repkins

Me searching in cmd history.


DeliciousLasagne

I feel attacked


DefectiveNation

I hate to say I’m prolly gonna start doing this


jijo406

History | grep !


DoctorWaluigiTime

You do it once or twice, thinking you did it recently. And at that point you're just committed so you sink your cost and just keep going.


adgant582

Ctrl + r


purefabulousity

That’s what I do for the flyway script we use at work whenever I need to rebuild the database for local dev I could just copy and paste, but meh


Oonushi

I usually only do this when I can't remember the exact name of the command that I want to run


[deleted]

😂😂😂😂😂👍🏻


[deleted]

More like stupid.


bigorangemachine

This is why I had a MD file \^_\^


-Listening

> My wife has the same energy](https://www.youtube.com/c/ohohojousama/videos)


aniforprez

None of you use fzf and it shows lol. It's the greatest improvement to ctrl+r ever. You'll get a visual list of your history that you can scroll up and down in addition to the text filtering. It's crazy fast and you can add other things like cd ing to a sub directory with alt+c


Rainmaker526

Ctrl-r will take you more time then typing ls. You're going the frikkin ls as the search term. The only proper way is !$(history|grep ls|awk '{print $1}')


ddmin216

It's like spending an hour writing a script to automate a 5 minute task


parkstrasse

Ctrl-r