How to Open Files and File Explorer From the Command Line - Windows 
Tags: commandline, zsh, beginners, windows
Published: 2019-01-11 03:54:03

---
title: How to Open Files and File Explorer From the Command Line - Windows 
published: true
description: 
tags: command line, zsh, beginner, Windows
cover_image: https://thepracticaldev.s3.amazonaws.com/i/quqwsaybv2h4i3uq07ry.png
---

##Terminal Upgrade

Last month I went down the rabbit hole setting up my terminal on my Windows laptop.  I had been using Git bash for all of my git & Github work, but did not have much other experience with the command line and wanted to improve my skills and upgrade my tools.  As a starting point I followed the free video series from Wes Bos called ["Command Line Power User."] (https://www.commandlinepoweruser.com) The goal of the video series is to get you up and running using Zsh and oh-my-zsh.  I also used the GitHub repo ["CmderZSH"](https://gist.github.com/dfontana/3e27ec5ea3a6f935b7322b580d3df318) by Dylan Fontana to help with some of the nitty gritty of installing on Windows.  I decided to go with the [Powerline9k](https://github.com/bhilburn/powerlevel9k) theme to add some customzation. 


##My Current Setup

I won't get into the process of setting it all up as the links above can help you with that.  With that being said, here is my current setup:

- [Cygwin](https://www.cygwin.com/)           ("...provide functionality similar to Linux on Windows")
- Mintty            (default terminal emulator for Cygwin)
- [Cmder](http://cmder.net)             (console emulator)
- Zsh               (Z shell)
- [oh-my-zsh](https://ohmyz.sh/)         (framework for managing Zsh configuration)
- Powerline9k theme
 

##Opening Files and File Explorer

After spending (more than anticipated!) time setting it all up, there was still something that I was struggling to get working.  In Wes' videos, he has examples of opening files in his code editor using the 'open' command.  I could not get it to work for me and after trying a few different things unsuccessfully, I left it and came back to it later.


##The Solution

After some searching, I came across the answer that I was looking for.  In Windows, we have a similar command to 'open' and that is the 'explorer' command.  Here are a few examples of the command in action.

###Open a File Explorer 
<a href="https://cl.ly/ff63b5fe222e" target="_blank"><img src="https://d1wuojemv4s7aw.cloudfront.net/items/3F43000h1N1W2d2x2W1B/Screen%20Recording%202019-01-10%20at%2009.28.35.65%20PM.gif" style="display: block;height: auto;width: 100%;"/></a>


###Open a File Explorer in Current Directory
<a href="https://cl.ly/0ddd8e6db00e" target="_blank"><img src="https://d1wuojemv4s7aw.cloudfront.net/items/0F3k0D2v0D3q0d183C2r/Screen%20Recording%202019-01-10%20at%2009.55.02.47%20PM.gif" style="display: block;height: auto;width: 100%;"/></a>

###Open a File with the Default Program
<a href="https://cl.ly/944244a932e0" target="_blank"><img src="https://d1wuojemv4s7aw.cloudfront.net/items/083b3R0k1X1S3S0B3Q1R/Screen%20Recording%202019-01-10%20at%2010.07.56.94%20PM.gif" style="display: block;height: auto;width: 100%;"/></a>

###Open a File with VSCode
*different command but similar functionality
<a href="https://cl.ly/4e27b1347331" target="_blank"><img src="https://d1wuojemv4s7aw.cloudfront.net/items/03282p1W1Z0x2h23431p/Screen%20Recording%202019-01-10%20at%2010.20.21.41%20PM.gif" style="display: block;height: auto;width: 100%;"/></a>


That concludes my first blog post since I started learning to code!  I have benefited greatly from so many posts and articles and I am hoping that I will be able to give back by sharing what I am learning as I dig into JavaScript and work towards landing a full time remote dev job.  Best of luck to everyone on their goals for 2019 and I hope to post again soon.