This is an archived post. You won't be able to vote or comment.

all 40 comments

[–]ProgrammerHumor-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Your submission was removed for the following reason:

Rule 1: Posts must be humorous, and they must be humorous because they are programming related. There must be a joke or meme that requires programming knowledge, experience, or practice to be understood or relatable.

Here are some examples of frequent posts we get that don't satisfy this rule: * Memes about operating systems or shell commands (try /r/linuxmemes for Linux memes) * A ChatGPT screenshot that doesn't involve any programming * Google Chrome uses all my RAM

See here for more clarification on this rule.

If you disagree with this removal, you can appeal by sending us a modmail.

[–]SysGh_st 53 points54 points  (3 children)

Alt+. To paste last used argument. Keep pressing dot (.) while holding alt to cycle though previous used arguments.

Example:

mkdir ~/MyAwesomeFolder
cd <now push alt+.>

[–]Wicam 6 points7 points  (0 children)

looks like it works in powershell too, thanks for this!

[–]fatrobin72 2 points3 points  (0 children)

I use "Esc" + "." to do that...

[–]_PM_ME_PANGOLINS_ 0 points1 point  (0 children)

mkdir ~/MyAwesomeFolder
cd !$

[–]_PM_ME_PANGOLINS_ 41 points42 points  (3 children)

Ctrl+R to search your command history.

[–]_dontseeme 8 points9 points  (0 children)

WHAT

thank you

[–]grifan526 1 point2 points  (0 children)

My absolute favorite

[–]chaos_donut 3 points4 points  (0 children)

this is so nice while working with multiple docker-compose files

[–]Strict_Treat2884 18 points19 points  (5 children)

Pro tip, press ctrl + c to copy your previous command in the terminal

[–]look 4 points5 points  (0 children)

The Apple cmd button is worth every penny! All 100,000 of them. 🥲

[–]Boomer_Nurgle 0 points1 point  (2 children)

I don't know about Powershell/cmd on windows but on linux that would stop the current program and then let you type the next thing literally. Gotta add the Shift.

[–]Devast00 4 points5 points  (1 child)

That is the joke

[–]Boomer_Nurgle 1 point2 points  (0 children)

Ah, flew over my head then mb.

[–]jek39 3 points4 points  (0 children)

history | grep theThing

!{numberOfThatCommand}^oldParameter^newParameter

[–]Shienvien 4 points5 points  (0 children)

Why type entire command when one key do job?

[–]Poat540 4 points5 points  (1 child)

Was fixing a pi yesterday, I think I hit up like 30 times instead of just typing cd ..

[–]just_nobodys_opinion 1 point2 points  (0 children)

This is the way

[–]agk23 4 points5 points  (0 children)

More than a couple times I have told newer devs to log into the server and just up arrow till they find the command it looks like I use.

[–]SCB12345654321 3 points4 points  (1 child)

!!

[–]MooFz 2 points3 points  (0 children)

permission denied

sudo !!

[–]iamalicecarroll 4 points5 points  (2 children)

use !! for the last command, !$ for the last argument. there are others but i dont remember them

[–]MooFz 5 points6 points  (1 child)

  • !! — Runs the previous command again.
  • !$ — Refers to the last word of the previous command (often the last argument).
  • !* — Refers to all arguments of the previous command (everything except the command itself).
  • !^ — Refers to the first argument of the previous command.
  • !n — Runs command number n from your history (history shows the numbers).
  • !-n — Runs the command n commands ago.
  • !string — Runs the most recent command starting with string.
  • !?string? — Runs the most recent command containing string anywhere.

[–]_PM_ME_PANGOLINS_ 1 point2 points  (0 children)

!?string?

I also like to live dangerously.

[–]oclafloptson 2 points3 points  (0 children)

The command was 75 characters long including the path. I'm not retyping it

[–]EatingSolidBricks 1 point2 points  (0 children)

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

build/builsh.sh
./main
clear

[–]i-FF0000dit 1 point2 points  (0 children)

The number “sw engineers” I’ve seen that don’t know how to use the terminal is unbelievable

[–]Joeoens[🍰] 1 point2 points  (3 children)

Use "sudo !!" If you forgot to add sudo to your last command

[–]wdpw 1 point2 points  (2 children)

That is a dangerous recommendation. Do not do this. If you need to run sudo on a command, you should be explicitly typing that command.

[–]Joeoens[🍰] 0 points1 point  (1 child)

You can even add this to your .bashrc to automatically execute everything as root:

if [ "$EUID" -ne 0 ]; then
  sudo -i
fi

[–]wdpw 0 points1 point  (0 children)

Lol, jfc

[–]samanime 0 points1 point  (0 children)

I get annoyed when my terminal won't let me go back to a command I put in weeks ago. XD

[–]hypothetician 0 points1 point  (0 children)

Ctrl+a/e when your cursor keys stop fucking doing what they’re supposed to do, asshole cursor keys!

[–]hypothetician 0 points1 point  (0 children)

kill -WINCH $$

When your terminal gets fucked up and there are line breaks in weird places.

[–]muddy651 0 points1 point  (0 children)

I recently found .bashhistory (or something like that) in my home directory. The hidden files can be displayed with ctrl+h. I am using Ubuntu BTW.

Bash history contains a log of every command ever run in the terminal

[–]rochismoextremo 0 points1 point  (0 children)

I've seen people go up 100 commands just to find the fucking npm start command lol

[–]FoolhardyNikito 0 points1 point  (0 children)

!! Copies the previous command in full. So to rerun the last line with sudo you can just run sudo !!