Shouting sudo 0 ▲ Blog on blog.gnoack.org 41 minutes ago · Tech · hide · 0 comments When a command fails because you forgot that you need to be root: $ pacman -Suy error: you cannot perform this operation unless you are root. Then you can shout “sudo” at your shell: $ sudo !! sudo pacman -Suy [sudo] password for gnoack: ... The !! expands into the previous command in your shell history. If you revisit that command in your shell history afterwards, you’ll find that it was actually recorded as sudo pacman -Suy. Documentation for this feature is in the “History Expansion” section of bash(1). Thanks Alejandro for sharing this trick! No comments yet. Log in to reply on the Fediverse. Comments will appear here.