Linux learning-Linux executable files

Source: Internet
Author: User

Linux file systems do not use file extensions to differentiate file types in windows. Generally, file types in Linux depend on file attributes, that is, the first four characters of binary files.
Linux recognizes the file header and attributes to open a file. You can execute the binary statement into A. txt file name, and run the statement as usual. It has nothing to do with the extension.

Use the LS-F command, and then buy the executable file.

 

The following is an excerpt from some related information:

In Linux, when you use./xxx to runProgramFirst, shell takes over your input, then use fork to dispatch the child process, and finally use the execv seriesCodeDeliver to Kernel

1. Check the attributes of the file you run. The attributes are described in its I node. If your file is not an executable attribute, the execution is denied, if an executable attribute exists, but the executable permission is higher than the permission of the user you are currently using, the execution is denied.
2. Is it a shell file? If yes, call the corresponding shell to parse your script file.
3. Is it the ELF file format ?? Is it coff file format? Is it a. Out file format? If either of them and the current Linux kernel supports these three file formats, the operating system kernel will analyze your file format, remove the file header information, and extract the real code, data is loaded into the memory (this is not the case in the actual process, but many details are omitted for the sake of simple description. For more details, see execv system calls in the kernel )...
4. Wait for system process scheduling. When the kernel selects your program, your program will run.

The end of the promise (mainly to be close to the Windows user's habits). Elf files do not require extensions. Therefore, when you say executable files, never say they are EXE files. That is not a strict statement, it only means that you are a Windows programmer.

Linux loaders generally recognize files based on the "magic sequence" embedded at the beginning of an executable file (a special byte sequence), and sometimes use some features of file names. For example, a Java compilation handler can ensure that the file name ends with. class, and the first four bytes of the file start are 0 xcafebabe, which is defined by the java standard. The following is a binary processing program provided by the 2.4 kernel in the Intel System. Theoretically, Linux is flexible enough to process almost all target file formats.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.