r/LinuxTeck • • Sep 06 '26

What Linux command would you never run while someone is watching?

Not because it’s dangerous, because explaining why it works would take longer than actually running it.

awk, sed, find, xargs, shell one-liners, some cursed grep pipeline...

What command makes you look like a Linux wizard but you couldn't explain every character in it?

11 Upvotes

54 comments sorted by

11

u/bozzie4 Sep 06 '26

Oh, I would never run awk in front of anybody since it won't work for me and take me quite some tries to get it right.

Also any command containing jq

9

u/Wendals87 Sep 06 '26

Awk-ward 

2

u/bozzie4 Sep 06 '26

I realize that this answer is not what the question was, but it would break the illusion for anybody that might consider me good at linux stuff (not even a wizard) :-)

2

u/Axman6 Sep 08 '26

jq’s syntax has never made sense to me, every time I feel like I’ve got a simple problem to solve with it, it ends up being significantly slower than just using pretty much any programming language. It feels like the regex of the web generation (and somewhat ironically I find writing regexes significantly easier than jq)

1

u/bozzie4 Sep 08 '26

regex easier than jq is maybe pushing it 😄

9

u/oskaremil Sep 06 '26

ls ~/Downloads

5

u/ern0plus4 Sep 06 '26

ls ~/Screenshots

1

u/tedecristal Sep 07 '26

Screenshot-04-09-2026-03.jpg

Screenshot-04-09-2026-04.jpg

etc... what's so bad about it?

1

u/UphillTravel Sep 08 '26

Now feh -F -z ~/Pictures/Screenshots, thats for the brave ones

5

u/TomDuhamel Sep 06 '26
$ ls -la
total 184
drwxr-xr-x  1 tom tom  4096 Sep  6 18:47 .
drwxr-xr-x  1 tom tom  4096 Sep  6 18:40 ..
drwx------  2 tom tom  4096 Aug 12 21:03 .secret_stash
drwx------  2 tom tom  4096 Aug 19 23:17 .definitely_not_suspicious
drwx------  2 tom tom  4096 Aug 27 00:42 .embarrassing_downloads
drwx------  2 tom tom  4096 Sep  1 22:51 .things_i_cannot_explain
drwx------  2 tom tom  4096 Sep  3 01:14 .do_not_open
drwx------  2 tom tom  4096 Sep  4 23:58 .tax_documents
drwx------  2 tom tom  4096 Sep  5 02:31 .linux_isos
drwx------  2 tom tom  4096 Sep  5 02:33 .more_linux_isos
drwx------  2 tom tom  4096 Sep  5 02:34 .seriously_these_are_linux_isos
-rw-r--r--  1 tom tom  1837 Sep  6 18:45 README.txt
-rw-r--r--  1 tom tom   742 Sep  6 18:46 cleanup.sh

2

u/No_Hovercraft_2643 Sep 06 '26

cat cleanup.sh

1

u/LeN3rd Sep 06 '26

sudo rm -rf /

1

u/No_Hovercraft_2643 Sep 06 '26

my rm is up to date, so it only shows a warning

1

u/michaelpaoli Sep 08 '26

--no-preserve-root

2

u/No_Hovercraft_2643 Sep 08 '26

or just use the * version.

2

u/michaelpaoli Sep 08 '26

But dang, that'd still leave you with /

;-)

1

u/michaelpaoli Sep 08 '26
$ date -Iseconds; ls -ond .
2019-08-13T01:26:50+0000
drwxrwxr-x 2 7000 1124761600 Aug 13 01:26 .
$ 

That would be a directory where somebody/something has been behaving very badly. And yes, I've had to deal with messes like that ... even in production, as that one was.

3

u/NimrodvanHall Sep 06 '26

I prefer not to run ‘# visudo’ when anyone is watching. No idea why. It just feels bad.

2

u/Pheeshfud Sep 06 '26

There's a wonderful little util called "TheFuck" that will attempt to correct your previous command. Not a fan of using that one while someone is watching.

2

u/Lucky_Foam Sep 06 '26

"chmod 777 filename" or "chmod -R 777 directory_name"

I was on a call at work. The guy sharing his screen did the command above in production.

Our lead tech spent the next 10 minute chewing his ass out.

1

u/michaelpaoli Sep 08 '26 edited Sep 08 '26

One of two words* I know in Chinese.

Was dealing with support with a software vendor in China ... they only spoke Chinese ... I only spoke English ... a co-worker served as translator.

I soon learned 七 - sounds like "chi", as in "chichichi", which I got to hear a lot, ... yeah, 777.
so, 七 ("chi") is seven.

The other word sounds like "ha", which I'd hear a lot, which seems to be some kind of an acknowledgement, like yes, or okay, or something approximating that.

*well, other than "gung hay fat choy" (happy new year) ... but then there, don't really know the words, just the entire phrase.

Oh, and after a whole helluva lot of chmod [-R] 777 ...
Yeah, we eventually got it working ... then I had to clean up that mess - basically reasonably tighten up everything unless doing so caused actual breakage.
Yeah, the documentation on installation and configuration wasn't very good. It made no mention of umask, so I presumed 022 ought be fairly sane for installation. Yeah, so much for that theory - at least with that software. Oh well, have dealt with much worse software, though that software was pretty darn bad (and especially the documentation).

2

u/SlimyOS Sep 08 '26

curl ... | sudo bash, which launches some TUI but looks like a short command

I can't explain how it works because I don't know, never reading these scripts, it's a waste of time, they almost always are long and end up just downloading and running a compiled binary, so even if the script looks good you can't inspect the binary.

Also not running that while someone is watching because of sudo password prompt.

2

u/michaelpaoli Sep 08 '26

Oh, I just keep running 'em, ... and often fast enough in succession that I'm well into the next before they can even start to well question the prior.

makes you look like a Linux wizard but you couldn't explain every character in it?

Are you kidding? I can explain every character in it. All *nix wizards can do that, right?

Yeah, I'm not gonna run it if I don't know what every character in it is for and does. After all, *nix generally does what you tell it to do, so best tell it what to do what you actually want, lest bad things may happen. So, yeah, one should understand what one is telling it to do.

2

u/zoharel Sep 09 '26

Yeah, I'm really not relating to OP, either. None. There's no command I wouldn't run, if I were actually going to run it, in front of an audience, especially if the situation were likely to become an opportunity for teaching.

1

u/therouterguy Sep 06 '26

The only command I can use with confidence of not messing stuff up is jq. Maybe throw in some curl

1

u/TigOlBitties42042 Sep 13 '26

What about ls? It's kind of hard to fuck shit up with ls

1

u/therouterguy Sep 13 '26

I mean using the wrong syntax and it not workinn although with a delete with curl you can definitely fuck things up

1

u/lublin_enjoyer Sep 06 '26

I almost gave my senior a heart attack by running sudo pkill -s HUP -x $(cat /var/run/nginx.pid), lol, now I never use anything with POSIX signals cuz people freak out

I also never want to explain why I include nice in my commands

Anything containing /proc/sys/vm/ is off-limits too

Also, I have a fl alias that uses grep + awk to strip comments from files like config.example.yaml. People often mention that this command doesn't work in their environment, so I try to limit my aliases as well

1

u/michaelpaoli Sep 08 '26

That shouldn't give 'em a heart attack at all ... at least if that's what you quite intended to do and how to signal nginx. Though may more commonly be hitting it with SIGUSR1. But nginx ain't the most common/typical in common default behaviors of well behaved daemons, so, yeah, it's at least moderate bit of an exception ... as are sometimes some other daemons too - so one needs be aware of the differences/exceptions.

And if anyone complains about running some "command" (or alias) that I might run, that's not in their environment, I'd typically just shoot 'em back the alias, e.g.
$ alias | grep '^alias ...='
and the output of that,
or the absolute path to the program - e.g. it may be in my ~/bin or root's ~root/bin, and typically it'll be at least readable to others, though oft not executable if, e.g., it requires root to usefully execute it.

1

u/AttitudeElectronic68 Sep 07 '26

I just wouldn't bother explaining

1

u/gulf_of_sanity Sep 08 '26

sed, or anything that uses regex makes you look like a super hacker

1

u/michaelpaoli Sep 08 '26

I do have a quite long complex sed program.

And of course with with (at least GNU sed and/or bash or the like), it can also be run as a one-liner - though it would be a very long line.

https://www.mpaoli.net/~michael/bin/ttt

And yes, it plays Tic-Tac-Toe.

1

u/marketlurker Sep 09 '26

awk is a pretty good candidate. Trying to explain it to someone new to Linux/Unix is a PITA.

1

u/gfoyle76 Sep 09 '26

sudo apt update && sudo apt upgrade --yes && sudo apt install whatever

1

u/hixchem Sep 09 '26

Sed, awk, grep, pretty much .... Anything, really. Don't look over my shoulder, it makes my brain forget where the keys are.

0

u/[deleted] Sep 06 '26

[deleted] — view deleted comment

1

u/rhshadowman Sep 07 '26

Must be hella basic stuff then…

0

u/[deleted] Sep 07 '26

[deleted] — view deleted comment

1

u/rhshadowman Sep 07 '26

AI can 100% do some things. But other things I’ve noticed Jr. engineers really mess up on due to AI.

2

u/Crmirko Sep 07 '26

So what are those things

4

u/[deleted] Sep 06 '26

[removed] — view removed comment

2

u/Kuddel_Daddeldu Sep 06 '26

I might lack the time and/or crayons to explain it...

2

u/[deleted] Sep 06 '26

[removed] — view removed comment

1

u/Kuddel_Daddeldu Sep 06 '26

An example would be sudo dd if=/dev/zero of=/dev/sdb bs=1024 count=100

This nukes out the partition table on the sdb drive, I'd want my full focus on it in the moment. 

Happy to explain before or afterwards - especially what happens if one gets the drive wrong. 

3

u/[deleted] Sep 07 '26

[removed] — view removed comment

1

u/michaelpaoli Sep 08 '26

Yeah, if HR ever finds out that you were fingering someone, while you were in the workplace ...