即使我已经设置了 $PATH 变量仍然找不到命令 [英] Even thought I have set the $PATH variable still command not found

查看:111
本文介绍了即使我已经设置了 $PATH 变量仍然找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac.echo $ PATH的输出为:

I am using a Mac. The output of echo $PATH gives:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/amazon/bin

但是当我跑步

chmod +x mwinit 

它给了我以下错误:

chmod: mwinit: No such file or directory

我想念什么?我一直在尝试修复它.任何帮助将不胜感激.

What am I missing? I have been trying from a long time to fix it. Any help would be appreciated.

推荐答案

首先,您必须知道mwinit文件所在的位置,您可能想尝试运行 whereis mwinit .

first you have to know where your mwinit file is for this you might want to try to run a whereis mwinit.

然后可以将chmod命令与mwinit的完整路径一起使用,或者改为运行以下命令:

then you can use the chmod command with the full path to mwinit or run the following instead :

chmod + x $(其中-b mwinit | cut -d''-f2)

然后您进行 hash -r 准备出发!

(hash -r将为可执行文件w/i $ PATH重新加载您的Shell哈希表)

(hash -r will reload your shell hash-table for the executable w/i your $PATH)

这篇关于即使我已经设置了 $PATH 变量仍然找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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