Monday, May 24, 2010

What is the equivalent of a .exe file in Linux?

Most of the time If you download something for Linux its a .tar.gz or .tgz but thats more like .rar or .zip file and then inside it is a bunch of C source code, so do I need to compile it? if so to what? I heard that .exe files won't run on a Linux machine so if I'm supposed to compile it what do I compile it to?? Any help would be appreciated (I'm good with Windows but a blundering idiot with Linux so keep that in mind if that helps)

What is the equivalent of a .exe file in Linux?
Learn the command line. The equivalent of an exe file in Linux is an ELF file. It is also used in Unix. Generally, it has no extension at the end. A look in your /bin /sbin /usr/bin or /usr/sbin directories will show you that programs like cat, tar and gzip don't have file extensions.





A program will execute if it has permission to execute. type "man chmod" in a terminal for more information on the subject. If you have just switched to Linux, then it is a very good idea to learn what the default method of installation is: Yum for Fedora/Red Hat, emerge for gentoo or apt-get for Debian and its derivatives such as Ubuntu and Knoppix (I generally use wajig which is a front end for apt-get on my Debian system). You can install from tar-gz files, but that is not recommended because if you run into bad trouble (which you can) and have to reinstall, you will lose any package you didn't install using the default, and many which you did. That said, sometimes it is necessary. If a package has C code, you probably do have to recompile it. If you are on Ubuntu, there is one necessary step first: install the package "build-essential" either from whatever front end you use or by going to the command line and typing "sudo apt-get build-essential" (do a "sudo apt-get update" first). By default Ubuntu does not install all the development packages which by default all the other Linux distros do. Then at the command line, cd to the directory where you unzipped the package and look either for files called README or INSTALL or a doc directory which may have those files in them. Generally they will give you instructions for compiling and installing your program using make from the build-essential package and an executable script in this directory called configure (which you invoke by typing "./configure" with the ./ meaning look in this directory for the command). These instructions do not require a lot of programming smarts, as a rule, but occasionally they do.





You can run exe files on your machine if you have Wine installed. You can check by typing "man wine". If you don't do an "apt-get install wine" (or for Fedora "yum install wine"). Then go on the net and look for documentation for it. In 1990 I had my first experience with the graphic user interface. My immediate reaction was, "This is evil". Seventeen years later my opinion hasn't changed. Learn the command line.
Reply:Good question. You need to extract that tar file. Then you should open the readme or install file using any editor and read them.


Some commands will be given for compiling the source codes.


You should type them in konsole under the same directory.


like


./configure


make


install


It will create the executable file. It may or may not have extensions unlike windows which has .exe extension. .bin is more common in linux for executable file.





Mostly success will be the result. Keep trying.
Reply:If you're a newbie at Linux, don't bother with the tar.gz's, etc - use your built-in installer to find, download, install and check the new programs you want.





In Ubuntu (which is what I use) it's under "Programs" then "Add / Remove..."





You didn't say what distro (flavour) you're using, but if you're using Ubuntu or another Debian-based Linux, and you can't find the program in the add/remove programs... do a Google search for "whatevertheprogramis .deb"





This will find an already compiled version that will probably work just fine!





If THAT doesn't work, search ubuntuforums.org; ask in there if you can't find the answer. They're very, very helpful in there.
Reply:Linux uses file permissions to determine whether a file is executable.





You can see the file permissions for a file by typing ls -l at the command prompt in Terminal.


To find out more about file permissions make a search for "file permissions Linux".





As for the downloaded files .tar etc - they are "packages" of an application (for instance) the vendor or author of the package should provide you with the information what to do with it.





Linux normally knows what to do with compressed files (such as tar files). However, some of this is Linux version dependant.


No comments:

Post a Comment