Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
441595d0
Commit
441595d0
authored
Oct 01, 2018
by
Griko Nibras
Committed by
Marc Cornellà
Oct 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sudo: add README file (#7177)
parent
b4007b54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
README.md
plugins/sudo/README.md
+57
-0
No files found.
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