aliases not working using sudo
by telometto from LinuxQuestions.org on (#5F14W)
Hi, all!
New to the forum and it would be rude not to introduce myself. I will try to keep it short:
I am fairly new to Linux (<1 year). I have tried "coming over" in the past (even though last time I tried to make the switch was around 10-15 years ago) but it was too difficult compared to Windows and, at the time, I didn't have the patience, so I kept falling back to Win. Windows 10 was the drop that did it for me; privacy and freedom are very important to me so it eventually became a no-brainer. I went b***s deep and directly nuked my hard drive and installed Linux. I distrohopped a bit before eventually settling on fedora. I just wish I had started earlier because then I would've known Linux as good as I know Windows.
Oh, well. Never too late, though, is it? :)
Enough chit-chat and over to my question: I created an 'aliases' file with custom aliases to shorten down commands I use often, but when I use 'sudo' with them, it tells me that there is no such command. However, if I do '_', which is a predefined alias for 'sudo', and then enter one of my custom aliases, it works :confused:
I guess my question is how can I use my aliases with proper 'sudo'?
I use zsh and oh-my-zsh
I have done:


New to the forum and it would be rude not to introduce myself. I will try to keep it short:
I am fairly new to Linux (<1 year). I have tried "coming over" in the past (even though last time I tried to make the switch was around 10-15 years ago) but it was too difficult compared to Windows and, at the time, I didn't have the patience, so I kept falling back to Win. Windows 10 was the drop that did it for me; privacy and freedom are very important to me so it eventually became a no-brainer. I went b***s deep and directly nuked my hard drive and installed Linux. I distrohopped a bit before eventually settling on fedora. I just wish I had started earlier because then I would've known Linux as good as I know Windows.
Oh, well. Never too late, though, is it? :)
Enough chit-chat and over to my question: I created an 'aliases' file with custom aliases to shorten down commands I use often, but when I use 'sudo' with them, it tells me that there is no such command. However, if I do '_', which is a predefined alias for 'sudo', and then enter one of my custom aliases, it works :confused:
I guess my question is how can I use my aliases with proper 'sudo'?
I use zsh and oh-my-zsh
I have done:
- alias ls='ls -GpF'
- source ~/.zshrc
- ln -s ~/Documents/.aliases ~/.oh-my-zsh/custom/aliases.zsh