I love articles on “Top X tools for…whatever”.  Recently, I was reading an article on essential tools for data scientists.  Tool #1: wget.  I’ve used wget in the past at work and suddenly realized I actually had a need for wget at home.  Unfortunately, wget is a tool for Linux operating systems, not Windows, the system I typically use at home.  What to do?  I’ve been using Git Bash quite a bit lately and that shell includes several Linux utilities.  Maybe it has wget?  No dice.  You can add more utilities to Git Bash, but I wonder if there’s a better solution.

Again at work I occasionally use Cygwin and was just about to download it to my home workstation when I suddenly said to myself, “Self, you silly goose!  Microsoft just released a Linux sub-system for Windows!  Why don’t you install that?”  So, that’s what I did!

Step 1: Enable the Linux Subsystem

Obviously, you’ll want to make sure you’re version of Windows 10 supports the Linux subsystem.  If it does, fire up a PowerShell command shell as Administrator.  The easiest way to do that is to right-click on your Start Menu icon on your taskbar.  A context menu will pop up with the option Windows PowerShell (Admin).  In the shell, execute this statement:


1
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Step 2: Install the Linux “app” of your choosing

I rarely use the Windows Store, but once you enable your system to support the Linux sub-system, you’ll have to jump into the store and install the particular flavor or flavors of Linux you prefer.  Yes, that’s right: apparently you can install more than one flavor of Linux.  HowToGeek.com has a detailed article on installing the Linux app from the Windows Store that I highly recommend.  I was particularly excited to see Kali Linux as an option!

Note well: It seems like Microsoft recommends not letting Windows software interact with files you manage in you Linux sub-system.  For my immediate purposes, I simply wanted to download some web resources with wget.  I would, though, like to read that downloaded content in one of my Windows browsers, but where the heck are those files?

To find your home directory in your Linux sub-system, follow these steps:

  1. Open Windows Explorer, and drop this in the address bar: %LOCALAPPDATA%\Packages
  2. That takes you to a directory of installed packages.  Find the directory of the Linux sub-system you installed (hint: the folder should start with the name of the distribution like “KaliLinux” and the timestamp of the folder should match the date and time you installed the sub-system).
  3. Double-click into the appropriate Linux folder then navigate to LocalState\rootfs\home and look for your user.

Now, you have access to the folders and files you created in your home directory.  Again, though, treat those resources with kid gloves.

So now you have wget and a host of other cool Linux tools all on Windows!