linux - 路径,/usr/bin/和/usr/local/bin/

标签 linux macos bash command-line watchr

我使用 gem install watchr 在 OS X (10.8.3) 上安装了 watchr。它安装在 /usr/bin/watchr

$ which watchr
/usr/bin/watchr

然而,当我试图调用它时,系统无法找到它。

$ watchr -v
-bash: /usr/local/bin/watchr: No such file or directory

我认为这与我的机器上的路径设置方式有关。我的问题:

  1. 修复它的正确方法是什么?
  2. 一般来说,哪些程序应该转到 /usr/bin/ 还是 /usr/local/bin/
  3. 当我这样做时$/usr/bin/watchr -e 'watch(./hello.txt) ...',我们是在查看当前目录中的 hello.txt 还是在 /usr/bin/ 中,即与 watchr 相同的目录?

最佳答案

您的命令路径被缓存为错误值。尝试更新 bash 为该路径存储的缓存目录。

hash -d watchr

我在这里找到了答案which ctags shows /usr/local/bin/ctags but when I run ctags it runs /usr/bin/ctags. How is this possible?

关于linux - 路径,/usr/bin/和/usr/local/bin/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16270480/

相关文章:

java - 无法使用 codesign 签署我的应用程序

bash - bash 如何以及为何将 "{xs[@]}"拆分为参数?

PHP 无法执行 xcodebuild,如何解决?

c - 使用 gcc -Q -v "options enabled"和 "options passed"有什么区别

linux - 这个语句在 Linux 上有什么作用?

python - 在没有 nohup + ps aux grep + kill 的情况下启动/停止后台 Python 进程

c++ - 编译 gcc-7.3.0 时出现 uint64_t 或 int64_t not find 错误

reactjs - WebRTC : Screenshare video quality constraints not working on latest version of MAC Safari in reactJS

c++ - Finder 列 View 修改事件列的宽度

bash - Bash 的命令行参数验证库