I following Michael's reply to see what executable formats my Ubuntu can recognize to execute
$ ls -l /proc/sys/fs/binfmt_misc/
total 0
-rw-r--r-- 1 root root 0 Apr 19 16:11 cli
-rw-r--r-- 1 root root 0 Apr 19 16:11 jar
-rw-r--r-- 1 root root 0 Apr 19 16:11 python2.7
-rw-r--r-- 1 root root 0 Apr 19 16:11 python3.5
--w------- 1 root root 0 Apr 19 16:11 register
-rw-r--r-- 1 root root 0 Apr 19 16:11 status
I have never intentionally changed anything there, and the files were created by default or when I installed some other programs.
$ cat /proc/sys/fs/binfmt_misc/cli
enabled
interpreter /usr/lib/binfmt-support/run-detectors
flags:
offset 0
magic 4d5a
What kind of executable format is this? I googled "magic 4d5a" and found https://en.wikipedia.org/wiki/DOS_MZ_executable, but I am not sure how the file was created there since it is not a native executable format to Linux. Did installation of wine
add it?
$ cat /proc/sys/fs/binfmt_misc/jar
enabled
interpreter /usr/lib/jvm/java-9-oracle/lib/jexec
flags:
offset 0
magic 504b0304
Is the above for JVM bytecode format?
$ cat /proc/sys/fs/binfmt_misc/python3.5
enabled
interpreter /usr/bin/python3.5
flags:
offset 0
magic 160d0d0a
Is the above for Python bytecode or Python?
$ cat /proc/sys/fs/binfmt_misc/status
enabled
$ cat /proc/sys/fs/binfmt_misc/register
cat: /proc/sys/fs/binfmt_misc/register: Permission denied
What is /proc/sys/fs/binfmt_misc/register
used for? Does it also allow some executable format?
Does ELF format need a file under /proc/sys/fs/binfmt_misc/
?
Thanks.