From f1623f42ee2ce4bbb75b84bd0c6f097b5cfe7b07 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 15 Apr 2020 18:14:54 +0200 Subject: [PATCH] create sudo.md initial --- pages.pl/common/sudo.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages.pl/common/sudo.md diff --git a/pages.pl/common/sudo.md b/pages.pl/common/sudo.md new file mode 100644 index 0000000000..8a85014dc2 --- /dev/null +++ b/pages.pl/common/sudo.md @@ -0,0 +1,23 @@ +# sudo + +> Executes a single command as the superuser or another user. + +- Run a command as the superuser: + +`sudo {{less /var/log/syslog}}` + +- Edit a file as the superuser with your default editor: + +`sudo -e {{/etc/fstab}}` + +- Run a command as another user and/or group: + +`sudo -u {{user}} -g {{group}} {{id -a}}` + +- Repeat the last command prefixed with "sudo" (only in bash, zsh, etc.): + +`sudo !!` + +- Launch the default shell with superuser privileges: + +`sudo -i`