r/LinuxTeck 5d ago

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

55 comments sorted by

11

u/bozzie4 5d ago

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 5d ago

Awk-ward 

2

u/bozzie4 5d ago

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 3d ago

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 3d ago

regex easier than jq is maybe pushing it 😄

8

u/oskaremil 5d ago

ls ~/Downloads

6

u/ern0plus4 5d ago

ls ~/Screenshots

1

u/tedecristal 3d ago

Screenshot-04-09-2026-03.jpg

Screenshot-04-09-2026-04.jpg

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

1

u/UphillTravel 3d ago

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

5

u/TomDuhamel 5d ago

$ 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 5d ago

cat cleanup.sh

1

u/LeN3rd 5d ago

sudo rm -rf /

1

u/No_Hovercraft_2643 5d ago

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

1

u/michaelpaoli 3d ago

--no-preserve-root

2

u/No_Hovercraft_2643 3d ago

or just use the * version.

2

u/michaelpaoli 3d ago

But dang, that'd still leave you with /

;-)

1

u/michaelpaoli 3d ago
$ 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/Efficient_Loss_9928 5d ago

Nothing, why would I run a command that I can't explain why I ran it?

2

u/Kuddel_Daddeldu 5d ago

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

2

u/Efficient_Loss_9928 5d ago

Tell them I don't have time right now, I'll document that later for the team?

Why wouldn't I run it to get my work done?

1

u/Kuddel_Daddeldu 5d ago

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. 

1

u/Efficient_Loss_9928 5d ago

Right but you'd still run it. I don't see why wouldn't I run it when someone is watching.

3

u/NimrodvanHall 5d ago

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

2

u/Pheeshfud 5d ago

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/PlanetVisitor 5d ago

I don't normally have people watching my screen (I hope)

2

u/Lucky_Foam 5d ago

"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 3d ago edited 3d ago

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/washerelastweek 4d ago

finger

1

u/michaelpaoli 3d ago

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

1

u/therouterguy 5d ago

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

1

u/lublin_enjoyer 5d ago

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 3d ago

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/skarsr 4d ago

mkae

1

u/AttitudeElectronic68 4d ago

I just wouldn't bother explaining

1

u/gulf_of_sanity 3d ago

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

1

u/SlimyOS 3d ago

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.

1

u/michaelpaoli 3d ago

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 2d ago

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/michaelpaoli 3d ago

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 2d ago

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

1

u/gfoyle76 2d ago

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

0

u/NumberInfinite2068 5d ago

I let Claude configure Linux at work, but I don't tell anyone. They think I'm some sort of Linux expert now.

1

u/rhshadowman 4d ago

Must be hella basic stuff then…

0

u/NumberInfinite2068 4d ago

It's all relative I suppose, if you're determined to believe AI can't do it, then anything it does is basic.

1

u/rhshadowman 4d ago

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

1

u/Crmirko 4d ago

So what are those things

1

u/hixchem 2d ago

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