Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
441595d0
Commit
441595d0
authored
Oct 01, 2018
by
Griko Nibras
Committed by
Marc Cornellà
Oct 01, 2018
Browse files
sudo: add README file (#7177)
parent
b4007b54
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/sudo/README.md
0 → 100644
View file @
441595d0
# sudo
Easily prefix your current or previous commands with
`sudo`
by pressing
<kbd>
esc
</kbd>
twice
## Enabling the plugin
1.
Open your
`.zshrc`
file and add
`sudo`
in the plugins section:
```zsh
plugins=(
# all your enabled plugins
sudo
)
```
2.
Reload the source file or restart your Terminal session:
```console
$ source ~/.zshrc
$
```
## Usage examples
### Current typed commands
Say you have typed a long command and forgot to add
`sudo`
in front:
```
console
$
apt-get
install
build-essential
```
By pressing the
<kbd>
esc
</kbd>
key twice, you will have the same command with
`sudo`
prefixed without typing:
```
console
$
sudo
apt-get
install
build-essential
```
### Previous executed commands
Say you want to delete a system file and denied:
```
console
$
rm
some-system-file.txt
-su: some-system-file.txt: Permission denied
$
```
By pressing the
<kbd>
esc
</kbd>
key twice, you will have the same command with
`sudo`
prefixed without typing:
```
console
$
rm
some-system-file.txt
-su: some-system-file.txt: Permission denied
$
sudo rm
some-system-file.txt
Password:
$
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment