Article 5F14W aliases not working using sudo

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:
  1. alias ls='ls -GpF'
  2. source ~/.zshrc
  3. ln -s ~/Documents/.aliases ~/.oh-my-zsh/custom/aliases.zsh
Thanks!latest?d=yIl2AUoC8zA latest?i=5RHHPX1m_mc:aeR4umBfvjA:F7zBnMy latest?i=5RHHPX1m_mc:aeR4umBfvjA:V_sGLiP latest?d=qj6IDK7rITs latest?i=5RHHPX1m_mc:aeR4umBfvjA:gIN9vFw5RHHPX1m_mc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments