删除 ghostscript 别名

uva*_*sal 10 command-line bash alias

我正在使用zshwhichgs作为git status. 但在 Ubuntu 上,gs是 ghostscript 的别名。我尝试卸载 ghostscript,但后来我得到了这个:

The program 'gs' is currently not installed. You can install it by typing:
sudo apt install ghostscript
zsh: command not found: gs
Run Code Online (Sandbox Code Playgroud)

我也试过:

unalias gs
Run Code Online (Sandbox Code Playgroud)

正如这里所解释的:

如何删除别名?

但这给了我unalias: no such hash table element: gs

我该如何解决这个问题?

ter*_*don 12

听起来您根本没有定义此别名。别名优先于散列的可执行文件,例如gsgs系统上的 存在根本不会影响别名。因此,只需将此行添加到您的~/.zshrc

alias gs='git status'
Run Code Online (Sandbox Code Playgroud)

保存文件,打开一个新终端,你应该一切都准备好了。

现在,ghostscript 非常有用,您可能想重新安装它。如果这样做,您可以将其作为\gs或运行command gs