Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如标题所示,我正在尝试运行一个可执行文件。当我尝试从其他目录运行它时,我收到“文件或目录不存在”错误。但是,当我在文件所在的目录中时,我没有问题。有什么建议么?
遇到此问题的其他所有人都永远无法执行他们的文件,无论他们当前位于哪个目录!
谢谢!
要执行 /tmp/virus.tmp,您需要运行:
/tmp/virus.tmp
您尝试改为运行:
./tmp/virus.tmp
失败,因为它试图做的是tmp在当前目录的目录中找到程序。(.是当前目录。)例如,如果您在/home/user/并键入./tmp/prog,它将尝试执行/home/user/tmp/prog。
tmp
.
/home/user/
./tmp/prog
/home/user/tmp/prog