解决bash: ./text: cannot execute binary file

在root用户下执行test下面的text文件

原文:
[root@localhost test]# ./text
-bash: ./text: 权限不够


PS:  然后我用chmod u+x text命令:

出现下文:
[root@localhost test]# chmod u+x text
[root@localhost test]# ./text
-bash: ./text: cannot execute binary file

以后执行这个文件都是提示: -bash: ./text: cannot execute binary file

方案:

不要使用-c参数。这样gcc -o text text.c,这样就可以直接./text。

转自:https://blog.csdn.net/bbs598598/article/details/7488837

猜你喜欢

转载自blog.csdn.net/m0_37806112/article/details/80559988
今日推荐