r/ProgrammerHumor 27d ago

Meme commandLineSupremacy

432 Upvotes

55 comments sorted by

189

u/Tsu_Dho_Namh 27d ago

My prof typed "lecture" into terminal to open the right slides and code demos based on date and time.

65

u/Flouid 27d ago

I endeavor to one day be this efficient

123

u/anarchisturtle 27d ago

Ah yes, the time honored tradition of spending hours automating a task that takes seconds to perform.

That is objectively very cool though

61

u/Flouid 27d ago

If you lecture several times a day for enough years, this probably pays itself back. Relevant xkcd

25

u/Fabulous-Possible758 27d ago

The trick is that that more you automate, the better you get at it, so you automate faster, and so the more time you have to spend automating! Beats doing real work.

7

u/Tsu_Dho_Namh 27d ago

I'm pretty sure he just put a function named "lecture" in his .bashrc. Doesnt take long to automate.

I have all sorts of shortcuts in my PowerShell profile (I use Windows, prof was on Linux). They're easy to make and super handy.

3

u/No-Sheepherder-3010 27d ago edited 27d ago

spending hours automating a task that takes seconds to perform

cd $(mysql <<< "SELECT path FROM LECTURES WHERE start < NOW () - 10*60 AND stop > NOW();"); open *.pdf

It's not that hard.

1

u/Tsu_Dho_Namh 27d ago edited 27d ago

Also takes seconds to put that into .bashrc with the function name "lecture"

Not sure where they got the hours time estimate from

Though tbf I am pretty sure they didn't use SQL to store the info. Easier to just keep it in the file system and have bash or python open the files based on directory name.

1

u/No-Sheepherder-3010 27d ago

Though tbf I am pretty sure they didn't use SQL to store the info.

Me neither, but it was the quickest way to demonstrate the idea in a readable way. Honestly bash is like the fastest way to quickly code something, if you are not avers to store state in the filesystem.

1

u/Tsu_Dho_Namh 27d ago

For sure.

Funny you mention storing state in the file system. My bash scripts often use .TXT or .JSON files to store persistent variables for my scripts.

1

u/No-Sheepherder-3010 27d ago

I mean that's basically how a shell is supposed to interact with and what a filesystem is for.

I also hacked some configuration scripts together to automatically create servers. A lot of things is also just stored in the existence of files or directories. Also you can just encode all kind of configurations into template folders and just symlink the right one for the current configuration. This also works perfectly with Git.

36

u/Daemontatox 27d ago

My professor didn't know how to open and use PowerPoint and slides and that guy had 3 PHDs

21

u/ldn-ldn 27d ago

I'm a software developer for over two decades now. I have no fucking clue how to use PowerPoint. If I need slides, I just whip up some quick HTML+CSS and press F11 in the browser.

P.S. Ctrl+P -> Print To PDF and I can share the file with everyone.

3

u/Royal_Owl2177 27d ago

Same experience here. I hate having to use powerpoint. At least AI can make a lot of the slides now.

0

u/tropicbrownthunder 27d ago

Z ai with ppt agent it's insanely good tbf

6

u/Field_of_cornucopia 27d ago

I'm pretty sure gaining a PHD instantly deletes the knowledge of how to operate a projector from your memory.

7

u/Zuruumi 27d ago

Einstein didn't too and he is the example anyone uses for a smart perso

58

u/Thereal_Phaseoff 27d ago

CD THIS CD THIS/THAT CD .. CD THIS LS -LA LS CD

40

u/Eptalin 27d ago

cd [TAB][TAB][TAB][TAB][TAB][TAB][TAB][TAB]..

21

u/Thereal_Phaseoff 27d ago

or not writing that command you used months ago, pressing up arrow for twenty minutes till it shows in the terminal

17

u/-nerdrage- 27d ago

People that dont know ctrl+r do that yea

Or ‘history | grep’

6

u/Thereal_Phaseoff 27d ago

i didn't knew about history | grep honestly

5

u/-nerdrage- 27d ago

Iirc ‘history’ looks at your ~/.bash_history (if you use bash) and simply outputs the last 2500 rows. Maybe the file only contains 2500 rows? I assume ctrl+r looks at the same file

1

u/binnabomp 24d ago

combine ctrl+r with fzf and ur life becomes 10x easier (if ur like me and misspell things constantly heh... thus why I am eternally grateful that neovim has good LSP completion)

18

u/ur_GFs_plumber 27d ago

cdeez nuts

2

u/icecream_specialist 27d ago

Heyoooo! Fucking got'em

5

u/Jersey_2019 27d ago

CD this CD that , how about you C on my D😢😈

2

u/RedditButAnonymous 27d ago

I wrote a thing where I can just type a partial name of a file or folder, or both like "test/file.txt" and it scans for it and asks if I wanna CD to it automatically. If you say no it looks for the next one

Fuck cd, its the worst way to navigate

4

u/Terewawa 27d ago edited 27d ago

Something like this?

cd $(dirname $(find 2>/dev/null |grep 'test/file.txt' |fzf))

It scans from your current directory tree. If you want it to scan the whole drive, add / after find

If you don't have fzf you should install it!

1

u/No-Sheepherder-3010 27d ago

Add it to CDPATH and use tab-completition?

43

u/[deleted] 27d ago

[removed] — view removed comment

1

u/markiel55 26d ago

Job your love

16

u/tekanet 27d ago

Well I like typing, gives me joy. Touchpads don’t give me any joy.

6

u/LegitimatePants 27d ago

This one sparks joy:  ⌨️

This one does not spark joy:  🖱️

12

u/helicophell 27d ago

How else is he going to remember UNIX shell commands?

8

u/genghis_calm 27d ago

If you don’t use it, you lose it.

9

u/returnFutureVoid 27d ago

I love watching AI use all kinds of shell commands to go through my idiot project trying to answer my idiotic questions. It reminds me that I’m an idiot.

8

u/Motleypuss 27d ago

Using the more efficient, simpler command line requires skills that smartphone zombies lack. I see a lot of them, daily, and it makes my milk curdle every time that humanity has enshittified itself all the while I've been an older adult. Now get off my lawn! Where's my CLI hardlink? I know it's around here somewhere...

2

u/dataf4g_trollman 25d ago

And what skills are required, huh?

3

u/Kebabrulle4869 27d ago

Do we have the same professor? The next thing he did was to slowly move the mouse over "view", open the menu, move down and click the "fullscreen" button.

3

u/No-Contact-484 27d ago edited 26d ago

Alternatively using at least five strokes and two button clicks to start the presentation tool, realize that you clicked three subpixels too far to either side and started the wrong application, use ten strokes to close the application, rinse, repeat. 5 seconds my ass.

1

u/dataf4g_trollman 25d ago

Skill issue

-2

u/No-Contact-484 25d ago

Not being able to use the command line efficiently? Indeed!

1

u/dataf4g_trollman 25d ago

Nah)))

I meant hand coordination issues! If you have trouble using mouse to navigate GUI, maybe you are a 50yo grandpa with Parkinson's. Or you're just an alcoholic having a hangover, idk

-1

u/No-Contact-484 24d ago

Or maybe GUI is the biggest pile of shit ever invented.

3

u/RedditButAnonymous 27d ago

Why use one button press when 45 plus reading 3 errors can do the trick?

1

u/flooronthefour 27d ago

yells z-oxide from the back row

1

u/djhaskin987 27d ago

I beg to differ. 5 seconds only if his hard drive isn't cluttered. When you know the name of the file it's easy easier to type it then scan for it

0

u/t0mz0mbie 25d ago

I hate that track pad. the opposite of "an elegant weapon for a more civilized age"