首页 > 解决方案 > 如何设置在linux中执行哪个二进制文件

问题描述

我的机器中有 2 个名为“jupyter-notebook”的二进制文件:

$ which jupyter-notebook

我得到结果:

jupyter-notebook is /usr/local/bin/jupyter-notebook
jupyter-notebook is /anaconda3/bin/jupyter-notebook

似乎当我键入$ jupyter-notebook它会自动运行第一个。如何配置它以运行第二个?

标签: linux

解决方案


您可以为此使用别名。在您的 shell 中运行以下命令。

别名 jupyter-notebook="/anaconda3/bin/jupyter-notebook"

如果你希望它是永久的,那么把它放在你的 shell rc 文件中。


推荐阅读