简体   繁体   中英

In Linux (Ubuntu), how do I determine which specific file was not found when I see “No such file or directory”

In Ubuntu, I give these commands and obtain this output:

soujanya@LLN-Ubuntu:~/workspace/openEAR-0.1.0$ ls -l SMILExtract
-rwxr-xr-x 1 soujanya soujanya 3789876 Aug 20  2009 SMILExtract
soujanya@LLN-Ubuntu:~/workspace/openEAR-0.1.0$ whoami
soujanya
soujanya@LLN-Ubuntu:~/workspace/openEAR-0.1.0$ ./SMILExtract
bash: ./SMILExtract: No such file or directory
soujanya@LLN-Ubuntu:~/workspace/openEAR-0.1.0$

SMILExtract is an executable file (not shell script) and I do not have access to the source code of this file. Maybe it calls some system() or maybe not, no way for me to know.

I have heard that this error might be if the file is 32-bit and I run it on a 64-bit system, so No such file or directory refers to the loader and not this file. I think this is not the cause in my case, but anyway, my question is:

Is there a way to find out WHICH file is No such file or directory ? Maybe a special variable in Bash or something like this.

You can run programs with strace , a tool that shows you which system calls are used by a program. It'll produce a lot of output, but you can see the files your program attempts to open. Run your program like this:

strace ./SMILExtract

要确定32/64位问题,你可以'提交./SMILExtract'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM