英文:
How can I permanently remove an added alias from zsh (MacOS Terminal)?
问题
I'm using MacOS and had the issue that my Terminal didn't react to the 'python' command, so I tried out what was recommended here (manually adding an alias to zsh with echo "alias python=/usr/bin/python3" >> ~/.zshrc).
Turned out this wasn't the perfect solution in my case, so I'd like to reverse it.
I tried the 'unalias' command, but this only works for the length of the Terminal session. If I reboot Terminal, the alias is still there. Is there a permanent way how to delete this manually added alias?
英文:
I'm using MacOS and had the issue that my Terminal didn't react to the 'python' command, so I tried out what was recommended here (manually adding an alias to zsh with echo "alias python=/usr/bin/python3" >> ~/.zshrc).
Turned out this wasn't the perfect solution in my case, so I'd like to reverse it.
I tried the 'unalias' command, but this only works for the length of the Terminal session. If I reboot Terminal, the alias is still there. Is there a permanent way how to delete this manually added alias?
答案1
得分: 1
- 用任何文本编辑器打开
.zshrc文件。 - 滚动到文件底部。
- 删除包含
alias python=/usr/bin/python3的那一行。 - 保存并退出。
Voila.
echo 命令与 >> 结合使用,只是将 alias... 追加到 .zshrc 文件的末尾,删除此行将永久删除该别名。
英文:
- Open the
.zshrcfile using any text editor. - Go to the bottom of the file.
- Delete the line that says `alias python=/usr/bin/python3"
- Save and exit.
Voila.
The echo command combined with >> is just appending alias... to the bottom of the .zshrc file, deleting this line will get rid of the alias permanently.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论