Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
./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

1 Answer 1

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 Sarcsam 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.