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.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Its been a while that ive been using RH Linux 7.3 and im just wondering why I couldnt even see any .exe or .com files within the directories.
How could it be possible for the files to run (even without the extensions of .exe or .com)
extensions aren't really needed in the *nix world. its not like windows and the way the filesystem is setup. most of the time extensions are used only so you know what type of file it is. i tend to use extensions on either image files like .jpg, .png.. , html files, and perl files.. .pl
File "extensions" are a "DOS" thing. In the early days of DOS, executable files had extensions of either .COM, .EXE or .BAT (and with priorities in that order). That was the only way to identify an executable file, by the extension (of course, the file actually had to be executable, or in the case of batch files, contain valid DOS and/or commands). These "properties" carried over into Windows, of course, as that is the structure that the Windows OS is built on.
In the *NIX world, file extensions aren't necessary. Files are identified as being executable if they have the "x" permissions set (as in "rwx"). If the permissions have been set for that particular user, the user could then read the file (if "r" is set), write the file (if "w" is set), or execute the file (if "x" is set), and these permissions exist for the owner (user), group and others.
Of course, for the file to execute properly, it would have to be a compiled binary executable, or a script that would then be interpreted by a shell (bash, ksh, tsch, etc.) or other language interpreter (like Perl or Ruby).
You may find that without an extension, if you were to try and "open" a file Windows will ask you what to open the file with, and without either a .COM, .EXE or .BAT extension, it won't even run. With Linux, as long as it's been assigned a permission of executable, it will certainly try to (whether it does or not depends not on any extension, but the contents).
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
The filesystem (and file typing) doesn't work the same under linux and
'doze.
Under MS, the extension of an 8.3 file defines what the file is, and the
OS treats it as being that kind of file (.exe => executable).
However, under linux (and any other decent OS), there are a few bytes
at the beginning of a file that defines what it is (the magic number). Those bytes exist in almost all files, but MS ignores them. The magic
number tells the OS what it should do with the file. If its magic number
defines it as a "binary executable", then the OS will try to treat it as
such. It doesn't matter what the file is named, it could be named Foo.jpg
and still be a binary executable file. This really frees the users to name
their files with much more reasonable and useful names (that and long
filenames). It also gets around the problem of getting confused by a
filename extension.
There happens to be a table in /etc/magic (usually) that basically gives
the definitions of filetypes, and with this table and a cool program called
"file" you can find out what kind of file you have, regardless its name.
do a:
file /etc/magic
This should give you :
/etc/magic: magic text file for file(1) cmd
So, the upshot of this is that you shouldn't expect to see files with the
.exe extension, as the filename extension is basically meaningless to
the OS. There are some distros and window managers that are
perverting this and looking at the filename to make decisions about the
file. This is pure sloppiness on the programmer's part.
There are some distros and window managers that are
perverting this and looking at the filename to make decisions about the file. This is pure sloppiness on the programmer's part.
I agree. Looking around for some fsckin Gnome deps I stumbled upon some sort of initative to even make it a core part of Gnome (dunno really, could be there already, see if I care). Actions based on extensions leads to anger, and anger leads to, ah well, yknow. Spose they haven't learnt anything from what tricks you can pull on wintendo.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.