Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-14-2009, 07:22 AM
|
#1
|
|
Member
Registered: Dec 2007
Posts: 93
Rep:
|
.bin, .elf, .out - Linux file extension
Hi,,
I have been reading the web and i found that they say the equivalent of .exe in linux is either .elf or .bin, is that true?
how do i get a file with .bin or .elf extension? cause AFAIK when compiling using gcc we get a.out.
thanks
|
|
|
|
09-14-2009, 07:36 AM
|
#2
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,581
|
Linux and other *nix don't use / need extensions.
Have a look in e.g. /usr/bin/ or do 'ls /usr/bin/'
.....
You only get a.out with no name specified.
' -o myobject ' will create 'myobject'
.....
Last edited by knudfl; 09-14-2009 at 07:39 AM.
|
|
|
|
09-14-2009, 07:51 AM
|
#3
|
|
Member
Registered: Dec 2007
Posts: 93
Original Poster
Rep:
|
Hi,,
And what about getting a file extension .bin?
i have seen some executables with .bin extension, how do we get that?
|
|
|
|
09-14-2009, 08:08 AM
|
#4
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,581
|
1) Files ending with ' .bin ' are most often binary installers.
And you are not getting a name. The name is decided by you, if
you are creating the file.
2) Most files can be renamed to any name and still be recognized
as their particular file type. The command 'file' can be used or
you can ask "Properties" to tell by right clicking the file.
In the desktop manager KDE : hoover the mouse cursor over the
file and get the type.
.....
Another example : 'photo.jpg' can be renamed to 'my-photo'
and still be opened by your favorite image viewer. No extension !
.....
|
|
|
|
09-14-2009, 08:43 AM
|
#5
|
|
Member
Registered: Aug 2009
Location: PA USA
Distribution: Arch Linux
Posts: 78
Rep:
|
Explination
To explain it from my understanding, its like this.
You state that when you compile a program using gcc you get a lot of a.out files. This is because you didn't specify a name. Using gcc --help or man gcc you can learn each different compiler option. To make a name you do this.
gcc -o MyProgram MySource.c
That takes your program that is called MySource.c and creates a file called MyProgram. Unlike windows the . extension is meaningless. A .bin file simply means a binary file. Which in the case I showed above MyProgram IS a binary file. So if you need to have a .bin extension you could do this.
gcc -o Prog.bin MySource.c
And there you go. Though Prog.bin and MyProgram are the same file with a different name.
-Jessica-
|
|
|
|
09-14-2009, 01:58 PM
|
#6
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
Quote:
And what about getting a file extension .bin?
i have seen some executables with .bin extension, how do we get that?
|
You just rename executable to executable.bin
The extension is irrelevant to linux.
Test it out:
Code:
tred@vaio:~$ file image.jpg
image.jpg: JPEG image data, JFIF standard 1.01
tred@vaio:~$ cp image.jpg image
tred@vaio:~$ file image
image.jpg: JPEG image data, JFIF standard 1.01
tred@vaio:~$
The file image will still open with the default application associated with the filetype JPG, even though it lacks the .jpg extension.
(Linux is usually more sensible than win.)
|
|
|
|
09-14-2009, 06:00 PM
|
#7
|
|
Member
Registered: Sep 2009
Distribution: Fedora
Posts: 835
Rep: 
|
Quote:
Originally Posted by raedbenz
Hi,,
I have been reading the web and i found that they say the equivalent of .exe in linux is either .elf or .bin, is that true?
|
No, it isn't. There are any number of files that are executable, and not because of their extension. Unices have an executable flag that is part of the information stored about a file, and that flag determines whether the file is executable.
In Windows, by contrast, a file's extension is important because the Windows file system is too primitive to include the concept of an executable flag.
Quote:
Originally Posted by raedbenz
how do i get a file with .bin or .elf extension? cause AFAIK when compiling using gcc we get a.out.
thanks
|
Use the "-o" option to choose a file name and extension:
$ gcc source.file -o output.file
It is up to you to decide whether the extension you choose is appropriate to the circumstances.
|
|
|
|
09-15-2009, 12:34 AM
|
#8
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 14,937
|
ELF is a (*nix) binary format: http://en.wikipedia.org/wiki/Executa...inkable_Format, not an extension.
As said above, xxx.bin is (usually) a self-extracting installer.
HTH
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:41 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|