Run Linux commands in Windows command prompt...

Discussion in 'Linux Beginners' started by cream-iteration.134, Sep 24, 2020.

  1. cream-iteration.134

    cream-iteration.134 New Member

    I understand there is a way to configure my Windows command line (ie. PowerShell), to run Linux tools and commands.
    Typing wsl into command prompt--followed by a Linux command (ie. C:\temp> wsl ls -la), should bear a list of C:\temp content. However, I received a message for installing a distribution--from the Microsoft Store. Why is this? Or is there a different approach to take--to have use of the Linux tools? Thanks.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Windows can not run Linux commands out of the box, but Windows has a builtin virtual machine which makes it possible to run Linux inside Windows and this allows it to run Linux commands in the end. So your next step is to download a Linux distribution of your choice from Microsoft store, as that message told you, and install it.
    cream-iteration.134 likes this.
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    wsl does not run linux commands in windows. it allows you to run a full linux shell from within the windows environment, you still need to install that variant of linux (ubuntu, debian, centos, suse etc) from the windows shop app, and then start the linux shell, which has it's own terminal. any commands you run are done in the linux environment, and in a linux filesystem, although you can directly access the windows filesystem: /mnt/c/, you still can't run linux commands from the windows command prompt. it is, in effect, a full, separate linux install, like a vm, but without it's own ip, xdesktop etc.

    you can, on windows, install cygwin tools, which will install a lot (not all) of the linux style commands, eg ls, rm etc. than you can run from the windows command prompt.
    cream-iteration.134 and till like this.

Share This Page