如果程序与另一个程序共享名称,如何通过终端运行程序

Kja*_*ara 0 command-line executable

我的系统上有 Ecplise 平台(编程环境,请参阅https://eclipse.org/)。它可以通过在终端中输入“eclipse”来运行。

现在我安装了 eclipse prolog(见http://www.eclipseclp.org/)。我按照http://eclipseclp.org/Distribution/Current/6.1_224_x86_64_linux/Readme.txt 中的说明进行操作),现在我想启动它。在这些说明中,他们说可以通过在终端中键入“eclipse”来运行它。

但是,如果我这样做,则只会启动 Eclipse 编程环境,而不会启动 Eclipse 序言。

现在我该怎么做?

我使用的是 Linux Mint 17、64 位。

xhi*_*nne 5

找出新eclipse安装的位置,不要只输入eclipse完整路径:/where/the/new/eclipse/is/installed/bin/eclipse

如果这个新的 Eclipse 成为您的首选,您可能需要在您的启动文件中定义一个别名(例如.profilefor sh):

alias eclipse=/where/the/new/eclipse/is/installed/bin/eclipse
Run Code Online (Sandbox Code Playgroud)

现在,如果您输入eclipse,将运行新的。要执行旧的,您必须指定其完整路径。

您甚至可以定义两个别名,每个别名一个eclipse

alias eprolog=/where/the/new/eclipse/is/installed/bin/eclipse
alias eplatform=/where/the/old/eclipse/is/installed/bin/eclipse
Run Code Online (Sandbox Code Playgroud)

... 并在 shell 提示符下输入eprologeplatform

  • 甚至还有两个别名,`eprolog` 和 `eplatform`。 (2认同)
  • @Kjara 找出您正在使用的 shell 并修改正确的文件。`.profile` 用于 `sh`,而你可以是 `bash`、`zsh` 或其他东西,每个都有自己的启动文件。 (2认同)
  • @Kjara,无论您使用哪种 shell,对相关启动文件的更改都不会生效,直到您通过登录新终端或执行`. 当前终端中的 .profile`(或其他启动文件)。 (2认同)