这是我按顺序输入的命令。我希望它能运行我的“简单 hello work”程序。
vagrant@vagrant-ubuntu-trusty-64:~$ ls
filename.zip tester
vagrant@vagrant-ubuntu-trusty-64:~$ file -b tester
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
vagrant@vagrant-ubuntu-trusty-64:~$ tester
No command 'tester' found, did you mean:
Command 'gtester' from package 'libglib2.0-dev' (main)
Command 'jester' from package 'jester' (universe)
Command 'testr' from package 'testrepository' (main)
tester: command not found
答案1
您的二进制文件不在 $PATH 变量/环境中,因此 shell 无法识别它。
您需要使用以下方式调用它
./tester
或者将其添加到路径中
set PATH=$PATH:/path/to/tester
要使路径更改永久生效,请将此行放入 ~/.bashrc 中
export PATH=$PATH:/path/to/tester