Executing a bin file in Linux/Ubuntu

Linux OS Topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Executing a bin file in Linux/Ubuntu

Post by Saman » Mon Apr 23, 2012 11:20 pm

I downloaded a file with extension 'bin' which states an executable file in the site I have downloaded it. But I try to execute it, it gave an error. I found out the problem was due to not setting file as executable. Here is how you could do it.

First type following command t see whether the file is executable.

Code: Select all

file /path/file.bin
It will return whether the file is "executable" and not "non-executable", not executable or something completely different. If you do not see "executable", the file is probably a CD-image(BIN/CUE) and not an executable .bin-file.

Now enter:

Code: Select all

cd /path
chmod +x file.bin
Now try to execute the file:

Code: Select all

/path/file.bin
Post Reply

Return to “Linux”