Séra Balázs to linuxmemes@lemmy.worldEnglish • 2 years agoSometimes less is morelemmy.worldimagemessage-square32arrow-up1247
arrow-up1247imageSometimes less is morelemmy.worldSéra Balázs to linuxmemes@lemmy.worldEnglish • 2 years agomessage-square32
minus-square@SteveTech@programming.devlinkfedilinkEnglish32•2 years agoI think you’d have to do echo o | sudo tee /proc/sysrq-trigger, otherwise sudo only works for the echo, not the write.
minus-square@outdated_belated@lemmy.sdf.orglinkfedilinkEnglish14•2 years agoHoly shit the reason for tee never really clicked until I saw this post. I’d used it in pasted commands, but it had always seemed superfluous.
minus-square@SteveTech@programming.devlinkfedilinkEnglish13•2 years agoIt writes to a file like >, and echos it back at the same time; in this case the latter isn’t needed (we’re just using it to write with sudo), but it’s good to know.
minus-square@GuyNoIRQ@infosec.publinkfedilinkEnglish8•2 years agoecho c | sudo tee /proc/sysrq-trigger 🫣
I think you’d have to do
echo o | sudo tee /proc/sysrq-trigger
, otherwise sudo only works for the echo, not the write.Holy shit the reason for
tee
never really clicked until I saw this post. I’d used it in pasted commands, but it had always seemed superfluous.What does
tee
do?It writes to a file like
>
, and echos it back at the same time; in this case the latter isn’t needed (we’re just using it to write with sudo), but it’s good to know.echo c | sudo tee /proc/sysrq-trigger
🫣Ah I guess I just use sudo bash a lot 😅