LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can Linux execute binary files? (https://www.linuxquestions.org/questions/linux-newbie-8/can-linux-execute-binary-files-250994/)

GiaCo 11-04-2004 06:05 AM

Can Linux execute binary files?
 
Hi there, I know this is probably a really silly question, but I am extremely new to Linux. I am using Fedora Core 2, and when I try to run a program I have downloaded, I am being told that Linux cannot execute the binary file? Is this a problem with this specific program, or is it a common fact that linux does not execute binary files??

Any help would be hugely appreciated!!

Haiyadragon 11-04-2004 06:19 AM

What kind of file is it? With what command did you try to execute it? You can try "sh <filename>" or "chmod +x <filename>" and then "./<filename>".

GiaCo 11-04-2004 06:21 AM

it's a program called ilatex, for converting files into latex. i chmod it to be777, then tried ./ilatex and got the error message that it could not execute a binary file. Is this a common occurance in Linux or is it just a problem with this program?

Thanks for your help :)

bahramH 11-04-2004 06:23 AM

executable programs are often in binary format, but not every binary file is a program. A tiff image file for example is in binary format. "Binary" means just "not text file" .
If the file you have downloaded is indeed an executable (by linux) binary file, then the problem is most probably its access
"rights". Each file under unix has three different rights : read, write and execute. And these rigths are defined for three diffrent classes of people : the owner, people in the same "group", and all the others. you can check the access rights of a file by typing "ll" or "ls -l".
To be short, if you want to restore the "execution" rights of a file for everybody, just type :

chmod uog+x filename

look in the man for details about access rights.

jschiwal 11-04-2004 06:31 AM

Is this a linux program that you downloaded? Type the command:
file ilatex

This will give you information on what kind of file it is.

Here is an example on my computer:
/bin/mv: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not stripped

That was a linux binary.

~> file /windows/c/Program\ Files/iTunes/iTunes.exe
/windows/c/Program Files/iTunes/iTunes.exe: MS Windows PE 32-bit Intel 80386i GUI executable

This one is a Windows binary.

Here is a link to the iLatex download page just in case you downloaded the wrong file.
http://www.cse.iitk.ac.in/users/isci...ds.html#ilatex

ugenn 11-04-2004 06:31 AM

Linux does in fact execute binary files (it would be a pretty useless system if it didn't).
Linux also executes text files (scripts).

However, unlike Windows, Linux executables (be they text or binary) need to have the execute permission enabled on the file.

If you downloaded the file, chances are, it's saved without the x bit set, so you need to enable it before executing:

eg chmod +x the_file_name

Note however, it's a bad idea to blindly execute files you downloaded without first verifying it free of malware. Especially when you're logged in as root.
If you

GiaCo 11-04-2004 07:17 AM

Hi, thanks so much for all of your replies. You're right it is a windows executable file. I went to that link, do i have to download all three fles? I tried that, and i am still getting error messages when I try to run them, I know I probably sound so stupid but I just cant get my head around Linux!!

Should i just use the rpm command on the two rpm files and then try to execute the other file?

thanks,

David the H. 11-04-2004 02:29 PM

The first link for each program on that downoads page is the RPM package version. This is the one you want to install. Install it like any other RPM (if you don't know how to install RPM's, learn how. It's how you install most programs). According to the man file they provide (under documentation), it's a simple command line program. There's no graphical component. You don't click on a file or anything. You type "ilatex [ -options... ] infile [-o outfile]" into a shell. Read the man file yourself for more details on how to use it (type "man ilatex" into a terminal).

The second link on that page is an RPM for the source code. You can tell by the .src in the file name. You don't really need it unless you want to compile the program yourself, and I don't get the impression that you want to do that. I'm not sure what the third links are for, but they're probably for use by Slackware and similar distros. They're compressed tgz files in any case. You probably don't want to fool with those either.

I don't see anything on that page, or indeed on that whole site, that looks like a Windows file. I mean, it's all about Indian language support on Linux. Why would there be a Windows version? Windows programs almost always have an .exe extension. If it doesn't end in .exe it's probably not a Windows file.

BTW, just for your information, there's a project called Wine which is dedicated to getting Windows applications to run on Linux. At this point some programs work, but many others don't. As you can guess, it's a complex problem, and it's going to be some time before everything works. See here for more. http://www.winehq.com/


All times are GMT -5. The time now is 10:46 AM.