Detect “Ubuntu on Windows” vs native Ubuntu from bash script [duplicate]
问题 This question already has answers here : How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu? (7 answers) Closed 2 years ago . Can a bash script detect if it's running in "Ubuntu on Windows" vs native Ubuntu? If so, how? I ran env on both machines and didn't see any obvious environmental variable differences. I could test for the existence of the /mnt/c directory, but that is not foolproof because that directory could potentially also be present on native