Cygwin commands
Cygwin is very useful if you are like me working on window operating system all the time want Unix like environment in window itself for testing. Cygwin provides native integration of Windows-based data, applications, and other system resources with applications, software tools, and data of the Unix-like environment. It means you have all Unix like structure in window command line with all Unix commands available.
- Below is folder structure of Cygwin when you installed in your window operating system:
- First things you do after Cygwin installation is to open its command prompt. Let me tell you there is two way to install Cygwin one is install through exe file and another one is just download an unzip Cygwin in window directory of your choice. If you have install it through exe file then Cygwin will add environment entry and will create shortcut on desktop to open its command prompt. But you have install it through zip and just unzipped in window directory then you will to set it class-path:
Set Cygwin environment variable:
- Add entry of of CYGWIN_HOME in user variable as below using this tutorial if you are not sure how to open window environment variable:
- Then add bin to the path variable as below:
- Once you have set the Cygwin path variable next thing start it using desktop shortcut. If its not created then go to %CYGWIN_HOME%\bin folder look for mintty.exe and double click to start Cygwin command prompt. It will look similar to below:
Now you are ready to use Cygwin commands. Below are frequently used commands:
- To see current directory path:
$ pwd
- To see who is the user:
$ whoami
- To check java home location:
$ echo $JAVA_HOME
- To see history of commands which is used:
$ history
For more information please visit Cygwin documentation here on its official site