How to run binary file in Linux

前端 未结 11 1257
执念已碎
执念已碎 2021-02-01 18:15

I have a file called commanKT and want to run it in a Linux terminal. Can someone help by giving the command to run this file? I tried ./commonRT but I

11条回答
  •  天命终不由人
    2021-02-01 18:31

    To execute a binary, use: ./binary_name.

    If you get an error:

    bash: ./binary_name: cannot execute binary file

    it'll be because it was compiled using a tool chain that was for a different target to that which you're attempting to run the binary on.

    For example, if you compile 'binary_name.c' with arm-none-linux-gnueabi-gcc and try run the generated binary on an x86 machine, you will get the aforementioned error.

提交回复
热议问题