找不到 Mac 终端 -bash 命令? [英] Mac terminal -bash command not found?

查看:53
本文介绍了找不到 Mac 终端 -bash 命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用终端完全陌生,在尝试使用 brew 安装一些东西时,我对 PATH 做了一些事情.现在,如果我告诉它做某事,它总是返回

I'm completely new to using terminal, and while trying to use brew to install some stuff, I did something to PATH. Now if I tell it to do something it always returns

-bash: blah: 命令未找到.

-bash: blah: command not found.

有什么办法可以重置一些东西来解决这个问题吗?我该怎么办?

Is there any way to reset something to fix this? What should I do?

推荐答案

您的路径通常在 .profile 或 .bashrc 文件中设置.这些位于用户主目录的根目录中.

Your path is usually set in either your .profile or .bashrc file. These are found in the root of your user's home directory.

您应该能够通过在终端中运行这两个命令来修复它们.它们包含默认的可执行路径

You should be able to fix them by running these two commands in the terminal. They contain the default executable paths

export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

这篇关于找不到 Mac 终端 -bash 命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆