7

Anybody else get an extra long path using echo $PATH command? I'm working in BASH shell Ubuntu on windows from the Windows app store.

Output of echo $PATH:

home/mnhir/bin:/home/mnhir/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Users/hersh/AppData/Local/Microsoft/WindowsApps:/snap/bin
6
  • is this your personal machine? or a work/commercial machine?
    – j-money
    Aug 17, 2018 at 4:11
  • also do you have a windows partition mounted?
    – j-money
    Aug 17, 2018 at 4:12
  • personal. fedora 7 Linux bible shows it stops after several bins. why is mine going to /usr/games:/usr/local/games Aug 17, 2018 at 4:12
  • what do you mean? its not a dual boot set up its ubuntu from windows store app terminal only. Aug 17, 2018 at 4:14
  • ubuntu uses E:/ and windows uses C:/ Aug 17, 2018 at 4:14

2 Answers 2

12

It looks like your Windows %PATH% has been appended to the Linux $PATH. And that is probably the case. See WSL interoperability with Windows:

To make Windows executables easier to run, Windows path is included in the Linux $PATH in Fall Creators Update.

This feature can apparently be disabled using the Windows registry, if it's not needed.

2
  • mainly I am working through this book to secure my network and browse anonymously. plus, I should've spent more on my laptop so im sending this pos back. I hate this laptop compared to my desktop. Aug 17, 2018 at 4:25
  • yeah I can dump creators updates. But, why would I want to do that? Sep 2, 2018 at 9:19
10

In WSL, you can now disable Windows paths getting added to $PATH by editing the /etc/wsl.conf file. You may need to restart your WSL session for this change to take effect.

An example of its contents would be:

[interop]
appendWindowsPath=false

More info can be found here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .