Removing ghostscript alias

I'm using zsh which uses gs as an alias for git status. But on Ubuntu, gs is an alias for ghostscript. I tried uninstalling ghostscript, but then I get this instead:

The program 'gs' is currently not installed. You can install it by typing:
sudo apt install ghostscript
zsh: command not found: gs

I've also tried:

unalias gs

As explained here:

How to remove an alias?

But that gives me unalias: no such hash table element: gs.

How do I solve this?


Solution 1:

It sounds like you simply don't have this alias defined. Aliases take precedence over hashed executables like gs, the presence of gs on your system wouldn't affect the alias at all. So, just add this line to your ~/.zshrc:

alias gs='git status'

Save the file, open a new terminal and you should be all set.

Now, ghostscript is quite useful and you might want to reinstall it. If you do, you can run it as \gs or command gs.