Search code examples
macosunixzshzshrc

Mysterious phantom rm -i alias


I'm using zsh on Mac OS 10.6.8.

So, all of a sudden one of my machines asks me for confirmation every time I rm.

Frankly, I hate this with an abiding passion. I've never had a problem with rm, and I don't need to debate the potentialities.

First thing I did was which rm, which reports rm: aliased to rm -i.

Now, I've hunted high and low for this alias. zshrc, .config (which I don't have), the default zshrc files: everywhere I can think of. No mention of aliasing rm anywhere.

Is there a simple way to determine where this alias is being configured? Or to list all locations where zsh might be looking for config lines?


Solution

  • Nope, there's no way to know which startup file an alias has been configured from, sort of searching them yourself.

    The Z-shell startup files can be found here.

    A comment for the question suggests /etc/profile; this is incorrect (unless you're sourcing it yourself), as /etc/profile is a Bourne-type shell startup file.

    If you can't find the place it's sourced, you could unset the alias [bottom paragraph] in ~/.zshrc: unset rm. That should work provided it's done after the alias is set.