1. Home
  2. Training Library
  3. Linux Administration Bootcamp Introduction | CSL4 V2 A3.1 |

Repeat as Root

Contents

keyboard_tab
Linux Administration Bootcamp
Installing and Connecting to a Linux System
2
Linux Boot Process and System Logging
33
Disk Management in Linux
36
Partitions
PREVIEW6m 50s
38
User Management in Linux
Shell Scripting with Linux
54
55
Repeat as Root
Overview
Difficulty
Beginner
Duration
7h 28m
Students
3
Description

In this course, you will learn how to install a Linux system and connect to it, whether that be on Mac or Windows.

Transcript

If you ever forget to run a command with root privileges you can simply repeat it by using sudo, space, exclamation mark, exclamation mark. Let's say if we were to add a user and we get a permission denied error. That's because we need to run it with super user privileges. We can run sudo, space, exclamation mark, exclamation mark. Or as I like to say, sudo, space, bang, bang. And then you can see that Sam was added.

Here's another example. This exclamation mark syntax that I'm using is called an event designator. An event designator references a command in your shell history. Bang, bang references the most recent command. But one of my favorite uses of the event designator is to run the most recent command that starts with a given string. For example, if we run a few commands, and we want to run the previous command that starts with u, we could type bang u and hit enter. So we can also do this with sudo. Sudo, bang, w. And it shows that we're running with root privileges.

You can also use the su command. So let's do this. And my root password here. And then we'll get rid of this user using this way as well.

About the Author