這是我按順序輸入的命令。我希望它能夠運行我的“簡單的你好工作”程序。
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