Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
./something

How does Linux know how to execute this if it's a shell script, or compiled machine code? I understand how the shebang works, but there doesn't seem to be anything like that here.

share|improve this question
up vote 2 down vote accepted

The binfmt subsystem of the Linux kernel recognizes various magic numbers at the start of the file and invokes the appropriate loader for it.

share|improve this answer
    
Thanks again Ignacio – Stephen Bugs Kamenar Jul 25 '13 at 2:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.