【问题标题】:How to uninstall Bash-it?如何卸载 Bash-it?
【发布时间】:2013-11-30 04:49:49
【问题描述】:

我还没有完全准备好使用Bash-it,我想回到原来的 CLI。任何关于如何删除 Bash 的建议都会很棒。谢谢你。

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

【问题讨论】:

  • 设置终端的默认shell或删除bash_it有困难吗?
  • 正在删除 bash_it。当我确实删除了 .bash_it 文件夹时,我得到了: -bash: /Users/waymond/.bash_it/bash_it.sh: No such file or directory way-MacBook-Pro:~ waymond1$
  • 在您的 /Users/waymond/.bash_it/ 目录中目前还有其他文件吗?
  • 没有。顺便说一句,感谢您的回复。
  • 不用担心。您能否确认在终端中输入“bash”会切换到默认的 bash shell。

标签: macos bash bash-it


【解决方案1】:

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

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

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

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

ls -1a

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

  • .bash-it(你要删除的目录)
  • .bash_profile(您当前的 bash 个人资料)
  • .bash_profile.bak(安装 bash-it 之前的 bash 配置文件)
sudo rm -rf .bash_it

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

mv .bash_profile.bak .bash_profile

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

ls -1a

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

  • .bash_profile

然后重启你的终端。

【讨论】:

  • 接受的答案实际上并没有回答问题?这是正确的答案。
  • 您不应该使用sudo 来删除~/.bash_it 文件夹,除非您使用sudo 克隆它。
【解决方案2】:

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

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

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

【讨论】:

    【解决方案3】:

    更改默认外壳

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

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

    这也可以在终端中完成:

    sudo chsh shell user
    

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

    如果您使用 iTerm,您还可以根据要在新窗口中打开的 shell 来选择默认 shell。 Command + , 会让您了解这些偏好。

    我不熟悉 bash_it 作为一个 shell,也没有找到任何明确的删除工具。每个 shell 扩展它的分支略有不同,因此很难遵循另一个 shell 删除指令——例如 Fish:source

    【讨论】:

    • 感谢您的所有帮助,皮平!帮了大忙。
    • @Waymond Shells 有时可能是一个混乱的地狱。继续!
    • 不回答问题 - 它不告诉用户如何卸载 Bash-it。问题不在于使用不同的外壳......
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    • 2021-09-23
    • 2013-01-30
    • 2018-11-24
    • 2011-03-06
    • 2019-03-18
    • 2013-07-15
    相关资源
    最近更新 更多