From 84713e06effdb44777cc7b75364f183617713596 Mon Sep 17 00:00:00 2001 From: kalebo Date: Mon, 22 Oct 2018 11:20:30 -0600 Subject: [PATCH] sudo: general revision of entry --- pages/common/sudo.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/common/sudo.md b/pages/common/sudo.md index 35380a060..72d5e02e9 100644 --- a/pages/common/sudo.md +++ b/pages/common/sudo.md @@ -1,23 +1,23 @@ # sudo -> Executes a single command as another user. +> Executes a single command as the superuser or another user. -- List the contents of an unreadable directory: +- Run a command as the superuser: -`sudo {{ls}} {{/usr/local/scrt}}` +`sudo {{shutdown now}}` -- Edit a file as the user www: +- Edit a file as the superuser with your default editor: -`sudo -u {{www}} {{vi}} {{/var/www/index.html}}` +`sudo -e {{/etc/fstab}}` -- Shut down the machine: +- Run a command as another user and/or group: -`sudo {{shutdown}} -h +10 {{"Cya soon!"}}` +`sudo -u {{user}} -g {{group}} {{id}}` -- Repeat the last command as sudo: +- Repeat the last command prefixed with "sudo" (only in bash, zsh, etc.): `sudo !!` -- Launch the default shell with root privileges: +- Launch the default shell with superuser privileges: `sudo -i`