ryaneberly
Most of us who’ve spent time tinkering with Linux or other Unix flavors have quickly discovered that there are some powerful tools available on most standard *nix installs that do not have an equivalent in windows.
Here are a couple of simple tasks:
Cygwin (cygwin.com) provides a great tool set for those who find themselves in Windows environments, but want to leverage the power of unix tools.
I first discovered Cygwin when working on a contract basis in software quality assurance (testing) for a large well-known semiconductor manufacturer. We were doing most of our work via telnet sessions on an AIX (unix) server, and I wanted to get a larger/friendly command window by running Xwindows locally and exporting the display from my session on the server to my local workstation. Unix has had remote desktop for a long time… As a result, all the tools that I had grown to appreciate in AIX were suddenly available on my workstation. I’ve kept a Cygwin install on my workstation ever since.
Installation:
Recommended modifications from the default packages.
Installation will take a few minutes. When it’s done, open your command prompt (Start->Run, ‘cmd’) and start experimenting (no ‘rm’ commands). Cygwin adds its bin folder to your PATH, so the commands are available. Certain windows commands share names with their approximate unix equivalents, so you need to give the explicit path to the cygwin folder when calling these. ‘find’ is an example of this.
Here’s some examples:
C:>which find
/cygdrive/c/WINDOWS/system32/find
No wonder it wasn’t working like I expected! Not that windows drive c: is mounted as /cygdrive/c, and most of the tools know how to navigate pure windows paths, but if possible use the unix form.
C:>echo test > somefile.txt
C:>cygwinbinfind somefil*
C:> echo testing >> somefile.txt
C:> echo something completely different >> somefile.txt
C:> echo testing >> somefile.txt
C:> echo testing >> somefile2.txt
C:> grep different *
C:> grep testing *
C:> grep -v testing somefile.txt
C:> cat somefile.txt | sed -e “s/ing/er/g”
C:> cat somefile.txt | sed -e “s/ing/[]/g”
I won’t get into how to use all these tools here. Google ‘grep’ or ‘sed’ or unix shell script for more info.