简体   繁体   中英

mac command line command not found

Ok so I've been trying to run some things from the command line and I'm having a 'permission denied' problem and then when I 'sudo ./(file.c' I get a 'command not found'. It's weird because other .c files in the same directory work ok.

I've downloaded and installed Xcode and command line tools. Also, I have #include some other things that are also in the same directory.

When I echo $PATH I'm getting this output: /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Thanks for any help that could be provided!

You're running sudo ./file.c but file.c looks like the name of a source code file which would usually not be executable. Probably the problem you're having is that you're trying to run something which cannot be run. If you really want to force the computer to run it, you can do chmod +x file.c before trying to run it. But if it is indeed C source code, it won't do anything useful.

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