From 940dd700fe33d91b81279e3c74d0d62bce348139 Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Wed, 24 Oct 2018 13:10:16 -0400 Subject: [PATCH 1/4] Create sudo.md Created file and added header --- _commands/basics/sudo.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 _commands/basics/sudo.md diff --git a/_commands/basics/sudo.md b/_commands/basics/sudo.md new file mode 100644 index 000000000..11544881f --- /dev/null +++ b/_commands/basics/sudo.md @@ -0,0 +1,23 @@ +--- +--- + +sudo +------- + +Short description of the command + +~~~ bash +*short* example of command usage and output +~~~ + + + +### Useful Options / Examples + +#### Example command + +##### Break it down + +#### Example command + +##### Break it down From 1d21d282d5065473108f7ab35d020405a012141a Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Wed, 24 Oct 2018 13:20:38 -0400 Subject: [PATCH 2/4] Added sudo summary and basic example --- _commands/basics/sudo.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/_commands/basics/sudo.md b/_commands/basics/sudo.md index 11544881f..fa311b741 100644 --- a/_commands/basics/sudo.md +++ b/_commands/basics/sudo.md @@ -4,20 +4,26 @@ sudo ------- -Short description of the command +`sudo` stands for *Super User DO* and allows the user to run any command as the root user ~~~ bash -*short* example of command usage and output +sudo shutdown -r now ~~~ - +The above command shuts down the system as the root user + +--- ### Useful Options / Examples -#### Example command +#### `sudo -u` + +The `-u` (user) option causes `sudo` to run the specified command as a user other than root. + +##### Example + +`sudo -u c4cs ls /home/Document` -##### Break it down +This command lists the contents of `/home/Documents` as the user c4cs -#### Example command -##### Break it down From 7381c21e255b2cf9d28a6b24993d207ee46e9da1 Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Wed, 24 Oct 2018 13:25:20 -0400 Subject: [PATCH 3/4] Added more sudo options --- _commands/basics/sudo.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/_commands/basics/sudo.md b/_commands/basics/sudo.md index fa311b741..7ddba0e06 100644 --- a/_commands/basics/sudo.md +++ b/_commands/basics/sudo.md @@ -18,7 +18,7 @@ The above command shuts down the system as the root user #### `sudo -u` -The `-u` (user) option causes `sudo` to run the specified command as a user other than root. +The `-u` (user) option causes `sudo` to run the specified command as a user other than root ##### Example @@ -26,4 +26,14 @@ The `-u` (user) option causes `sudo` to run the specified command as a user othe This command lists the contents of `/home/Documents` as the user c4cs +#### `sudo -v` +The `-v` (validate) option updates the users timestamp and extends the sudo timeout for 5 minutes + +Assuming one already has sudo access, running this command will allowing them to continue using the same sudo privledges for 5 minutes without authentication + +#### `sudo -k` + +The `-k` (kill) option removes a user's timestamp from sudo and takes away + +The next sudo command will require a password From 4671d2e0b94c5bbc743c9ce55837949fdf301eb4 Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Wed, 24 Oct 2018 13:29:45 -0400 Subject: [PATCH 4/4] Added sudo -b documentation --- _commands/basics/sudo.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/_commands/basics/sudo.md b/_commands/basics/sudo.md index 7ddba0e06..3e5c39b82 100644 --- a/_commands/basics/sudo.md +++ b/_commands/basics/sudo.md @@ -28,12 +28,22 @@ This command lists the contents of `/home/Documents` as the user c4cs #### `sudo -v` -The `-v` (validate) option updates the users timestamp and extends the sudo timeout for 5 minutes +The `-v` (validate) option updates the users timestamp and extends the `sudo` timeout for 5 minutes Assuming one already has sudo access, running this command will allowing them to continue using the same sudo privledges for 5 minutes without authentication #### `sudo -k` -The `-k` (kill) option removes a user's timestamp from sudo and takes away +The `-k` (kill) option removes a user's timestamp from `sudo` and takes away their root privledges The next sudo command will require a password + +### `sudo -b` + +The `-b` (background) option will run the command listed in `sudo` in the background + +#### Example + +`sudo -b g++ hugeFile0.cpp hugeFile1.cpp hugeFile2.cpp -o largeExecutable` + +This command will compile the three given files (potentially taking a very long time) in the background as the root user