Run UNIX/LINUX commands in Windows

unix

If you do not have Linux machine handy with you and if you want to run UNIX or Linux commands which could be executed only in the Linux machine are really difficult situation. Couple of day’s back I got few UNIX commands that I had to run in Linux machine. But I had only Windows 7 operating system installed in my system that was not helpful at all to run UNIX commands. Finally I started thinking how we can run UNIX or Linux commands in Windows machines if there is no any Linux operating system installed system available and finally got the solution.

There is a tool named Cygwin that needs to be installed in your windows machine. It’s quite easy to install and run. What all you have to do, you have to download Cygwin setup .exe file and install in your Windows machine. Cygwin provides the platform to run UNIX commands in Windows machines.

Please follow the instructions to install Cygwin software and run UNIX commands in Windows machine without any additional Linux system required:

1) Go to the link and download Cygwin setup .exe file – Click Here

Make sure you are downloading the appropriate version based on your operating system. (Check your system is either 64 bit operating system or 32 bit operating system). I have downloaded 64 bit because my operating system is 64 bit. You can check your operating system by Start->Right Click on Computer->Select Properties.

2) Once setup.exe file gets downloaded, double click on .exe file to initiate the installation process.

cyg1

3) Click on Next button to proceed installation.

cyg2

4) Leave the default option selected as Install from Internet and click on Next.

cyg3

5) Leave the default name Root Directory and click on Next.

cyg4

6) Click on Next.

cyg5

7) Click on Next again.

cyg6

8) Select any download mirror and click on Next.

Similarly keep on clicking next until you get this screen-

cyg7

9) It will take a little long time to download and install so please keep patient. After successfully installation, go to your desktop and double click on icon-

cyg8

Or Go to Start and click on Cygwin64 Terminal option.

cyg9

10) Once you double click you will see the Cygwin window looks similar as Windows command prompt.

cyg10

On this window also you can write UNIX commands and execute. But using this window you can’t update or access any file. So might be it’s not much useful here.

To perform other additional operation and to work on normal Windows command prompt we need to set Cygwin path.

Please follow the process to set the Cygwin path to work on normal Windows command prompt.

1) Go to Start and Right Click on Computer and Select properties.

cyg11

2) Click on Advanced system settings shown on left side.

cyg12

3) Click on Advanced tab and then Environment Variables button.

cyg13

4) Under system variables select Path and then click on Edit button.

cyg14

5) In variable value at the end add ;C:\cygwin64\bin\

cyg15

6) Click OK and close all the windows opened.

Open your windows command prompt and type any LINUX command. I have typed here “echo” and got the result ECHO is on. Wow it works!

cyg16

Now you have successfully set the path and ready to run UNIX commands in Windows default command prompt.

Hope you are happy with running LINUX commands in the Windows machine.

11 Responses to “Run UNIX/LINUX commands in Windows”

  1. Mohammad imran says:

    Thank you

  2. Saravanan says:

    Thanks

  3. Jimit Shah says:

    Thank You Naveen.

  4. Bhagyashree says:

    This is the best link . I followed instructions and now its working. Thanks a lot.

  5. Chris pembroke says:

    thank you very much I got to the end of this and it did as you said very helpfull

  6. zoldkovacs says:

    hello.

    I downloaded nic demo application from nic.comuf.com.
    working fine ,but when i run batch script ,always display splash screen maybe 10 sec.
    How can i remove splash screen when run batch script.?
    thanks
    z

  7. Peeush says:

    With cygwin, can we execute any kind of shell scripts we know or are there any limitations?

  8. Veena says:

    this article is very helpful. Thanks a ton :)

  9. Manoj Kumar says:

    Mentioned steps are very helpful. Could you please provide same information to install Unix in Window XP and Window-10

  10. jeetu says:

    good information

  11. Ashwini says:

    I am trying to execute Unix commands but this is not working on windows 7..giving this error”command no recognized by internal or external command”

Leave a Reply

Your email address will not be published. Required fields are marked *