1

I am trying to install a build tool on my Mac called please; however it seems the word "please" is already aliased to "sudo" and I don't know where that alias is being set.

I'm using Oh My Zsh which means I have a ~/.zshrc file instead of a ~/.bashrc file. But I can tell you that nowhere in my ~/.zshrc file nor in my ~/.bash_profile file are any aliases being set on the word "please."

Still, when I type please in the terminal I see this:

usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...

And when I type which please it just says this:

please: aliased to sudo

Are there other locations I'm not thinking of where aliases can be defined? How do I get rid of this annoying alias?

music2myear
  • 40,472
  • 44
  • 86
  • 127
soapergem
  • 1,586
  • 10
  • 26
  • 43
  • Your question isn't "why is...", it is "how do I remove an alias", which is a good thing: We can't answer "why" questions, generally. Some dev decided to, that's why. But we can answer "how do I...". I've edited the question to clarify this. – music2myear Nov 01 '18 at 15:26
  • That's fair, although I certainly have a lingering "why" in my mind, since usually the reason an alias shows up in the first place is because you've defined it in one of those files that I mentioned above. Since it's not defined as such I still wonder what else is causing it to show up. – soapergem Nov 01 '18 at 15:27
  • Also, this question may already have an answer here: https://apple.stackexchange.com/questions/229886/how-do-i-change-delete-alias-in-os-x-permanently Give it a look-see and let us know. If that does not answer your question, please edit this one to clarify how it is different. – music2myear Nov 01 '18 at 15:29
  • It is indeed different. Did you read mine? Did you read the one you linked to? The answer you linked to was essentially "remove the alias command from your `~/.bashrc` file." I stated pretty clearly in my question above that I do not have a `~/.bashrc` file; instead I have a `~/.zshrc` file because I use ZSH, and moreover that there are no alias commands in my `~/.zshrc` file at all. Word of advice: please read questions thoroughly before jumping to conclusions. – soapergem Nov 01 '18 at 15:32
  • I'm not going to get into a spitting contest. I read your question. Shells share many common elements, and there are plenty of results on the question "how do I remove an alias in macos". How Zsh differs may or may not be salient. Further, you specifically noted that the alias was not apparent in the .zshrc file. Further, ZSH apparently does use the "unalias" command referenced in the linked question, and further searching reveals this question which is specific to ZSH and recommends that very command: https://superuser.com/questions/786956/how-to-remove-zsh-alias – music2myear Nov 01 '18 at 15:43
  • This one offers another method: https://unix.stackexchange.com/questions/161973/clear-or-disable-aliases-in-zsh – music2myear Nov 01 '18 at 15:46
  • 1
    I know neither `zsh` nor MacOS but in Linux there may be global rc scripts in `/etc`. I would try `grep -rl "alias please" /etc 2>/dev/null`. Not sure if it helps on Mac. – Kamil Maciorowski Nov 01 '18 at 15:49
  • I discovered the reason why this is a problem. It's in the [oh-my-zsh code](https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/misc.zsh#L26) here; they explicitly set the alias. – soapergem Jan 17 '19 at 16:21

0 Answers0