Skip to content

Instantly share code, notes, and snippets.

@wcypierre
Last active December 10, 2015 08:08
Show Gist options
  • Save wcypierre/4405324 to your computer and use it in GitHub Desktop.
Save wcypierre/4405324 to your computer and use it in GitHub Desktop.
[HOWTO] Setup Linux shell on Windows | Allows Windows to run Linux commands!
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/11_zpsc34518c4.png[/IMG]
Want to do this on your Windows OS?
To install a linux shell on Windows, there's a few solutions solutions that I usually prefer:
1. Msysgit
2. Cygwin
3. Powershell
In this tutorial, Msysgit is the program that will be installed as apart from giving you a linux shell, it gives you access to do git related things(clone a repo, fork repo) which is a very good plus :)
So, here's it, we'll install a linux shell on our Windows OS and have fun with it later on :)
[B]Installation[/B]:
1. [URL="http://code.google.com/p/msysgit/downloads/list"]Click here[/URL] and download the latest version of msysgit(The latest version of the time of writing is 1.8.0 [URL="http://code.google.com/p/msysgit/downloads/detail?name=Git-1.8.0-preview20121022.exe&can=2&q="]http://code.google.com/p/msysgit/downloads/detail?name=Git-1.8.0-preview20121022.exe&can=2&q=[/URL])
2. Open the installer and you will see something similar to this:
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/1_zpsfd81f4b4.png[/IMG]
Click [B]Next[/B] to continue
3. After that, you will be shown the gpl license as per shown below:
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/2_zps8429c122.png[/IMG]
Click [B]Next[/B] to continue
4. You will be prompted where to install msysgit at.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/3_zpsf53199e7.png[/IMG]
You can choose the default location or change as you please
5. You will be prompted for additional settings, click [B]Next[/B] to continue.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/4_zpsda0baabe.png[/IMG]
6. You will be prompted for the startup menu, click [B]Next[/B] to continue.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/5_zps1a8f0a03.png[/IMG]
7. You will be prompted for the path environment, select [b]Use Git Bash only[/b] and click [B]Next[/B] to continue.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/6_zps6edb0c20.png[/IMG]
8. You will be prompted for the line ending adjustment. Select [B]Checkout as-is, commit Unix-style line endings[/B] and click [B]Next[/B] to continue.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/7_zpsb7e5f45b.png[/IMG]
9. The installer will install the required files.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/8_zps10dc9e28.png[/IMG]
10. The installation has finished! Untick [B]ReleaseNotes.rtf[/B] and click [B]Finish[/B] to end the installation.
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/9_zpsa16afe69.png[/IMG]
[B]Usage[/B]:
1. Right click on an empty space at your desktop and click [B]Git Bash[/B].
[IMG]http://i1352.photobucket.com/albums/q647/wcypierre/XDA%20Linux%20Shell%20Tutorial/10_zpsd57b3997.png[/IMG]
2. Type your linux "hackish" commands! ;)
The command that is used in the first screen shot is ls -la(directory listing with the file permissions of each file).
There's a lot of commands that you can play with, like echo, cat, uname, which, grep, sed, and many many more!
NOTE #1: For the best compatibility, cygwin would be preferred as it has a very complete set of linux commands built-in but Msysgit is less hassle to setup and it allows you to mingle around with Git once the setup is done which is a very good thing :)
NOTE #2: Msysgit is not preferred as a shell to create anything advanced like roms or kernels as the features that are available at mysysgit is rather limited(but it is enough for most users like us :) ).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment