shell 在其内存中保存一个关联表,将命令名称映射到其完整路径。安装 port 后,会安装新命令,但 shell 的内存表不会更新。当您再次登录时,新的 shell 重新计算该表,并且可以看到该命令。您可以使用 rehash 命令重新计算表,而无需注销。
Some shells require that you run rehash for them to "see" new executable in path. This is the case of csh or zsh, for example. See the csh man page. Your shell under freebsd is probably a c shell derivative.
The shell keeps in its memory an associative table, mapping command names to their full path. When your port is installed, the new command is installed, but the shell's in memory table is not updated. When you log again, the new shell recomputed this table, and the command is seen. You could use the rehash command to recompute the table without having to log out.
发布评论
评论(1)
某些 shell 要求您运行 rehash,以便它们“查看”路径中的新可执行文件。例如,csh 或 zsh 就是这种情况。请参阅csh 手册页。你的 freebsd 下的 shell 可能是 ac shell 的衍生品。
shell 在其内存中保存一个关联表,将命令名称映射到其完整路径。安装 port 后,会安装新命令,但 shell 的内存表不会更新。当您再次登录时,新的 shell 重新计算该表,并且可以看到该命令。您可以使用
rehash
命令重新计算表,而无需注销。Some shells require that you run rehash for them to "see" new executable in path. This is the case of csh or zsh, for example. See the csh man page. Your shell under freebsd is probably a c shell derivative.
The shell keeps in its memory an associative table, mapping command names to their full path. When your port is installed, the new command is installed, but the shell's in memory table is not updated. When you log again, the new shell recomputed this table, and the command is seen. You could use the
rehash
command to recompute the table without having to log out.