Séra Balázs to linuxmemes@lemmy.worldEnglish • 11 months agoSometimes less is morelemmy.worldimagemessage-square32fedilinkarrow-up1225arrow-down123
arrow-up1202arrow-down1imageSometimes less is morelemmy.worldSéra Balázs to linuxmemes@lemmy.worldEnglish • 11 months agomessage-square32fedilink
minus-square@SteveTech@programming.devlinkfedilinkEnglish31•11 months 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.orglinkfedilinkEnglish13•11 months 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.devlinkfedilinkEnglish12•11 months 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.
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 😅