作为参考,我对Linux知之甚少,正在使用它来运行别人编写的程序。说明说Add the executable 'ttt' to the search path. In most installations this can be accomplished by linking the file to the 'bin' subdirectory at user home.
我该怎么做?
此可执行文件当前位于主机区域的子文件夹中,因为它在双引导计算机上运行,我无法改变它是双引导的事实,因为它是一台工作计算机。
Tho*_*ard 32
要使其适用于命令行(终端):
我建议您在终端中执行以下步骤:
bin
在您的主目录中创建一个名为的文件夹。
mkdir ~/bin
Run Code Online (Sandbox Code Playgroud)添加~/bin
到PATH
Bash 的所有会话(终端内部使用的默认 shell)。
$ nano ~/.bashrc
# Add the following to the end of your .bashrc file while using nano
# or your text editor of choice:
export PATH="/home/$USER/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)无论是可执行文件本身或者符号链接添加到可执行成~/bin
通过关闭终端并重新打开它source ~/.bashrc
来重新启动终端会话,或者运行以重新加载会话的配置
这应该允许您的终端读取PATH
终端会话的变量。
不过,我不知道如何将它添加到 GUI,因为我不确定 GUI 如何管理PATH
变量,但如果此方法在此处不起作用,则可能需要使用其他方法修改路径图形用户界面。