microsoft / microsoft/WSL

Improve integration of Linux tools with Windows command line

Open
#1,823 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

It seems to be impossible to execute Linux tools from cmd or anywhere else outside bash.exe.

For example, I can't run grep from cmd:

C:\>C:\Users\test\AppData\Local\lxss\rootfs\bin\grep
'C:\Users\test\AppData\Local\lxss\rootfs\bin\grep' is not recognized as an internal or 
external command, operable program or batch file.

C:\>C:\Users\test\AppData\Local\lxss\rootfs\bin\grep.
'C:\Users\test\AppData\Local\lxss\rootfs\bin\grep.' is not recognized as an internal or 
external command, operable program or batch file.

If I give grep the .exe extension, it still doesn't work:

C:\>bash -c "sudo cp /bin/grep /bin/grep.exe"

C:\>C:\Users\test\AppData\Local\lxss\rootfs\bin\grep
This version of C:\Users\test\AppData\Local\lxss\rootfs\bin\grep.exe is not compatible with
the version of Windows you're running. Check your computer's system information and then
contact the software publisher.

It would have been great to be able to use Linux tools directly from Windows scripts. Otherwise I am kind of forced to keep cyg *cough* win installed.

Maybe automatically give executable ELF files an .exe extension and/or have the Windows subsystem recognize them and forward to Lxss?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported commands from Windows cmd and bash.exe, using the /bin/grep example and the attempted grep.exe invocation. Determine how executable Linux tools are currently handled outside bash.exe; done means Linux tools can be invoked directly from Windows command-line scripts without the compatibility error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, linux
Domain
cli, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.