davidktw
Arch-Supremacy Member
- Joined
- Apr 15, 2010
- Messages
- 13,547
- Reaction score
- 1,299
For so many years of using Linux and yet I'm not aware of this old gem. Well it's hard to be mastering Linux after all, isn't it ?
Lets see if there are other Linux experts around whom can observe what is the interesting part based on the behaviour of the commands listed below.
Hint: I was researching on Rosetta 2 on Linux ARM64 VM when I trip upon this gem and found it is a system-wide solution that it not limited to running x86 binaries on ARM64 architecture, but it is applicable to other stuffs like Python and Java and many more.

Lets see if there are other Linux experts around whom can observe what is the interesting part based on the behaviour of the commands listed below.
Code:
$ cat test.py
print("Hello World")
$ ls -al test.py
-rwxrw-r-- 1 ubuntu ubuntu 21 Sep 4 01:56 test.py
$ ./test.py
Hello World
$ cat test.java
public class test {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
$ ls -al test.java
-rwxrw-r-- 1 ubuntu ubuntu 104 Sep 4 02:19 test.java
$ ./test.java
Hello World
$
Hint: I was researching on Rosetta 2 on Linux ARM64 VM when I trip upon this gem and found it is a system-wide solution that it not limited to running x86 binaries on ARM64 architecture, but it is applicable to other stuffs like Python and Java and many more.