Linux - SoftwareThis 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.
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
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 !
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.
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.
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.
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.