如何卸载 Bash-it?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20296664/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 08:48:45  来源:igfitidea点击:

How to uninstall Bash-it?

macosbashbash-it

提问by Waymond

I'm not quite ready for Bash-itand would like to go back to the original CLI. Any advice on how to remove Bash-it would be awesome. Thank you.

我还没有为Bash-it做好准备,我想回到最初的 CLI。关于如何删除 Bash 的任何建议都很棒。谢谢你。

Edit: Would love to know why I'm getting down voted so I don't make the same mistake twice.

编辑:很想知道为什么我被否决了,所以我不会两次犯同样的错误。

采纳答案by Pippin

To change default shell

更改默认外壳

System Preferences > Users & Groups > click the lock to make changes > right click (or Control click) on current user image > choose "Advanced Options"

系统偏好设置 > 用户和组 > 单击锁进行更改 > 右键单击​​(或控制单击)当前用户图像 > 选择“高级选项”

You'll then see an option that will allow you to change the default shell. Once you reset the shell it it will change to the selected shell.

然后,您将看到一个选项,允许您更改默认 shell。重置外壳后,它将更改为选定的外壳。

enter image description here

在此处输入图片说明

This can also be done in terminal with:

这也可以在终端中完成:

sudo chsh shell user

where shell is the shell you'd like to use (zsh,bash), and user in your case is waymond.

其中 shell 是您想要使用的 shell (zsh,bash),您的情况下的用户是waymond。

If you use iTerm, you'll also have further options for selecting the default shell depending on which shell you'd like to open in a new window. Command + ,will get you to these preferences.

如果您使用 iTerm,您还将有更多选项来选择默认 shell,具体取决于您想在新窗口中打开哪个 shell。Command + ,将使您获得这些偏好。

I'm not familiar with bash_it specifically as a shell and haven't found any explicit removal tools. Every shell spreads it branches slightly differently so it's tricky to follow another shells removal instructions -- for example Fish: source

我不熟悉 bash_it 专门作为 shell,也没有找到任何明确的删除工具。每个贝壳展开它的分支都略有不同,因此很难遵循另一个贝壳移除说明——例如鱼:

回答by Jonathan Mundy

I wanted to do the same thing. Here's a link to removing bash-it:

我想做同样的事情。这是删除 bash-it 的链接:

https://github.com/revans/bash-it/issues/161

https://github.com/revans/bash-it/issues/161

I found it by going to the 'Issues' tab on the GitHub repository and then selecting 'Closed' issues.

我通过转到 GitHub 存储库上的“问题”选项卡,然后选择“已关闭”问题来找到它。

I used this list of commands from my home directory:

我使用了主目录中的以下命令列表:

ls -1a

This shows the list of files in the directory, including hidden files. You should see these in the list:

这将显示目录中的文件列表,包括隐藏文件。您应该在列表中看到这些:

  • .bash-it(the directory you'll delete)
  • .bash_profile(your current bash profile)
  • .bash_profile.bak(your bash profile before installing bash-it)
  • .bash-it(你要删除的目录)
  • .bash_profile(您当前的 bash 个人资料)
  • .bash_profile.bak(安装 bash-it 之前的 bash 配置文件)
sudo rm -rf .bash_it

This removes the bash-it directory. You'll be prompted for your password.

这将删除 bash-it 目录。系统会提示您输入密码。

mv .bash_profile.bak .bash_profile

This overwrites the bash profile created by bash-it with your original bash profile.

这会用您的原始 bash 配置文件覆盖由 bash-it 创建的 bash 配置文件。

ls -1a

You should now only see this file from the list above:

您现在应该只能从上面的列表中看到这个文件:

  • .bash_profile
  • .bash_profile

Then restart your terminal.

然后重启你的终端。

回答by nwinkler

Bash-it now has an uninstall script. To uninstall Bash-it, do the following:

Bash-it 现在有一个卸载脚本。要卸载 Bash-it,请执行以下操作:

# CD into the Bash-it directory
cd $BASH_IT

# Make sure you have the latest version that includes the uninstall script
git pull origin master

# Run the uninstall script
./uninstall.sh

# Remove the ~/.bash_it folder
cd ..
rm -rf $BASH_IT

# Now close this shell and open a new one

The uninstall script will try to restore your previous Bash configuration file (.bash_profileon Mac OS X, .bashrcon Linux).

卸载脚本将尝试恢复您之前的 Bash 配置文件(.bash_profile在 Mac OS X 上,.bashrc在 Linux 上)。

Once you have run the uninstall script, simply open a new shell and Bash-it shouldn't be used anymore.

一旦你运行了卸载脚本,只需打开一个新的 shell,Bash-it 就不再使用了。