All Questions
18
questions
0
votes
1
answer
440
views
How to list only the aliases defined by the user?
I'm using the ZSH and defined some aliases (stored in multiple fines, that are loaded in the ~/.zshrc). That is working fine. Executing the command alias allows to list all available aliases.
Now I'd ...
1
vote
2
answers
907
views
How can I/Should I default flags when running a command?
For context, I'm using zsh. Every time I use locate, I want to pass the -i and -A flags.
Usually, if I can get away with it, I create an alias with the same name as the existing command to do this. ...
0
votes
0
answers
301
views
Custom alias outside .zshrc but ZSH_CUSTOM doesn't work in kali
For reference this is not a duplicate: I reviewed other Q and A like this but it doesn't work for me.
Background:
I'm using Kali in parallels.
To keep my .zshrc file tidy I decided to mkdir ...
1
vote
3
answers
3k
views
How do I make an alias for a command with sudo
I want to add two aliases, so one executes a command when non sudo, and the other executes a command when sudo, like this:
alias v = 'nvim'
alias 'sudo v' = 'sudo -E nvim '
I also have set alias sudo=...
9
votes
1
answer
6k
views
How to overwrite aliases in my shell (Oh My Zsh)?
I would like to alias my ls command, but there is a previously defined alias for it which I believe gets invoked first before my definition! I am using .zshrc to define my alias, and here is what I ...
2
votes
2
answers
400
views
create an alias on ZSH but need to type it twice
I'm trying to create an alias on ZSH.
The aim of the alias is to activate a python virtualenv.
I've put a line in my .zshrc
alias SOU="source /home/andykw/.zshrc && source $(setopt ...
2
votes
2
answers
150
views
Create new set of aliases based on current set of aliases (eg. gst -> dst)?
I'm using git aliases from zsh plugins: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
So it has git aliases like:
gst # git status
ga # git add
gc "commit" # git commit -v "...
1
vote
2
answers
20k
views
zsh: When running source I get zshrc:116: unmatched
So today I wanted to add some extra alias to zsh.
I did the usual
nano ~/.zshrc
and added my alias
ex:
alias desktop="cd desktop"
(I've doubled checked that all variables for typos)
Ctrl+...
0
votes
1
answer
365
views
Having sudo and non-sudo parts in an alias - why does it not work with >>?
I was trying to use an alias which should run two commands, where the first is fine to be run with normal user privileges and the second one needs sudo privileges.
alias hosts-get="scp [email protected]:...
1
vote
1
answer
2k
views
How to use aliases with auto completion in oh-my-zsh?
I'm using zsh on MacOS El Capitan. I'm wondering how auto completion has to be parameterized to resolve aliases as well.
When I used bash, my .bash_profile contained the following:
alias mdb "mongo -...
0
votes
1
answer
535
views
Using zsh alias to quickly clone a git repository with custom folder name
I want an alias shortcut to achieve the following:
Clone a github repository with a custom folder name
Open it in my fav text editor (atom)
I currently use this inside ~/.zshrc:
alias quickstart="...
15
votes
4
answers
13k
views
Using zsh autocompletion for alias
I have created a few aliases for git in zsh. For example: gch = git checkout, grb = git rebase --committer-date-is-author-date and some more complex useful zsh functions for git commands. But how can ...
0
votes
2
answers
498
views
ZSH function to edit a file based on an input at the cli
I need to set up a function in zsh that would edit a different file based on some input at the command line.
I want to simplify my aliases so I don't have multiple aliases to do the same thing but ...
9
votes
3
answers
6k
views
sudo: nocorrect: command not found
I am using zsh and oh-my-zsh on Arch Linux. I am not able to make directory using mkdir
edward@ArchLinux ~ $ sudo mkdir -p /samba/raspberry
[sudo] password for edward:
sudo: nocorrect: command ...
3
votes
2
answers
1k
views
How to create hyphen alias for zsh?
I am using zsh and oh-my-zsh on Ubuntu.
To change into the recent directory in the past there was an alias set to - which is the same as cd -. Somehow the alias disappeared at my machine. This might ...