1293
Linux Users (lemmy.ml)
(page 2) 50 comments
sorted by: hot top controversial new old
[-] deacon@lemmy.world 6 points 2 weeks ago

Wow this is really validating for me to read. I’ve been using Linux for a few years but I’m definitely not a computer expert and am intimidated by the command line.

I’ve always felt like googling every command and arrowing up to find an old entry rather than just googling it again marked me as a fake Linux user, not a real one.

[-] cm0002@lemmy.world 6 points 2 weeks ago

Lol don't feel bad, I can do advanced crazy shit with Linux like pivoting the running OS into RAM so I can unmount the boot drive to do whatever without ever rebooting

But I still [Web Search] commands a shit ton of the time LMAO

[-] zarkanian@sh.itjust.works 4 points 2 weeks ago

You can use Ctrl-R and Ctrl-Shift-R to search through your history instead of having to push up a bajillion times.

load more comments (2 replies)
[-] merc@sh.itjust.works 6 points 2 weeks ago

Too many people still use Bash.

load more comments (12 replies)
[-] desmosthenes@lemmy.world 6 points 2 weeks ago
[-] remon@ani.social 5 points 2 weeks ago

You have to be a linux user to use the console now?

[-] Olgratin_Magmatoe@slrpnk.net 5 points 2 weeks ago* (last edited 2 weeks ago)

grep | history [search term]

load more comments (4 replies)
[-] iAvicenna@lemmy.world 5 points 2 weeks ago

history | grep then !cmd no

[-] Tiberus@lemmy.dbzer0.com 4 points 2 weeks ago

I accidentally found out one day that I could use a wildcard operator in the terminal instead of a full file or folder name due to always doing this.

cd Pho* or cd /documents/Pho*

Will for example open my "Photo Examples" folder in the working directory or based on the path

[-] merc@sh.itjust.works 6 points 2 weeks ago

With ZSH there's something called "path-completion" that makes that even easier.

Say you want to go to "/usr/local/share/fonts" but that's too much to type out, you can instead type "cd /u/l/s/f" and hit tab. If every path element is unambiguous it will just expand it to "/usr/local/share/fonts". In this case though, "/u/l/" can expand to "/usr/local" or "/usr/lib" so when you hit tab it moves the cursor to just after the "l" to indicate it needs you to distinguish between "/usr/local/" and "/usr/lib". If you just type "o" and hit tab again, it will know that there's only one match for "/usr/lo" and expand that to "/usr/local/" Then there's only one match for "s" which is "share", and only one match for "f" which is "fonts".

That avoids the danger of executing a command with an asterisk wildcard.

load more comments (2 replies)
[-] JasonDJ@lemmy.zip 4 points 2 weeks ago

You can use || between two commands as well. If the first command returns exit code != 0, the second command will run.

I.e. which ansible || pip install ansible.

[-] merc@sh.itjust.works 4 points 2 weeks ago

Or && for if you only want the second command to run if the first command succeeded.

[-] TheOakTree@lemmy.zip 3 points 2 weeks ago* (last edited 2 weeks ago)

This only works until you grow an addiction to making pho at home and start documenting your progress.

cd "Pho Recipes and Pictures"

[-] DarkAri@lemmy.blahaj.zone 3 points 2 weeks ago* (last edited 2 weeks ago)

cd /

sudo rm -rf *

Basically the Linux version of deleting system32 but idk I'm not a super Linux nerd yet.

[-] bandwidthcrisis@lemmy.world 5 points 2 weeks ago

The fun thing is that you can create a file named "-rf *" and hope an admin tried to delete it!

[-] dreadbeef@lemmy.dbzer0.com 4 points 2 weeks ago

Fish once again undefeated. If I want to find that weird image magick command I used earlier with foo.png in it I just type foo.png, hit up and its usually the first one. It doesnt matter where foo.png occurs in the command, fish will find it.

[-] nullPointer@programming.dev 4 points 2 weeks ago

zsh tab completion also looks through history wich is pretty nice.

[-] titanicx@lemmy.zip 4 points 2 weeks ago

I'm in this picture, and I didn't like it....

[-] clashorcrashman@lemmy.zip 4 points 2 weeks ago

...Yeah, you got me.

[-] janAkali@lemmy.sdf.org 4 points 2 weeks ago* (last edited 2 weeks ago)
  • zsh-autosuggestions
  • history | fzf
  • alias cat="bat --plain --theme=gruvbox-dark"
load more comments (5 replies)
[-] RedSnt@feddit.dk 4 points 2 weeks ago

I write part of the command then ctrl+r. Using FZF mind you. Such a great utility.

[-] MashedTech@lemmy.world 4 points 2 weeks ago
load more comments (2 replies)
[-] wewbull@feddit.uk 3 points 2 weeks ago

The one people see me doing that gets a "huh?" Is:

~$ !find
find -type f -name '*blah*' -print0 | xargs -0 gzip
~$

"Wait! What did you do?" "Oh. Do you not know about bang?"

load more comments (4 replies)
[-] T156@lemmy.world 3 points 2 weeks ago* (last edited 2 weeks ago)

Being able to just enter a partial command, and hit [up] to jump to prior commands that started in the same way in zsh is a godsend.

load more comments (2 replies)
[-] stealth_cookies@lemmy.world 3 points 2 weeks ago

This is why I like atuin, I can just press up and start typing part of the command and it will likely find it in my history.

load more comments (1 replies)
[-] RustyNova@lemmy.world 3 points 2 weeks ago

Oh come on! I at least type the beginning so that it filters the history

load more comments
view more: ‹ prev next ›
this post was submitted on 24 Sep 2025
1293 points (98.1% liked)

Programmer Humor

26827 readers
1549 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS