Monday, March 23, 2015

Unix Commands in Windows Command Prompt

I have always been a DOS command kind of guy (dubbed DOS Command Warrior) since the early days.  I've used unix/linux and was familiar with the command set but I wasn't as fluent as I was with DOS.

In the past few years I've transitioned into the inverse and have done the whole wrong commands in a Windows Command Prompt window a lot.  Tonight I decided to look up whether there are any binaries or anything I could install to still utilize the Windows Command Prompt and have the luxury of also using Unix commands.

Of course I could install Cygwin and use that terminal window, but I am comfortable with the Windows Command Prompt and I like to keep things somewhat simple.  Why not take advantage of Unix Commands from Cygwin within the Windows Command Prompt?  Thank you sir, may I have another!

I found this article on lifehacker.com that explains just that.  Super simple.

1.  Install Cygwin
2.  Open your Windows System Properties (Start > Run > sysdm.cpl)
3.  Click on the Advanced Tab, then click the Environmental Variables button



4.  Select the Path variable and click Edit



5.  At the end of the text, add a semicolon followed by the path to your Cygwin 'bin' directory - Mine is ;C:\Cygwin64\bin



6.  Click OK 3 times.
7.  Open a Command Prompt
8.  Profit