Blog Post

Power up Windows with old guard Unix tools

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:

  • Search multiple files for a specific word or series of words.   (grep <pattern> <filepattern>)
  • Rename a list of files accord to pattern. (i.e. change all files ending in *.txt to *.rtf)
  • More powerful scripting than good old DOS Batch files.
  • Comparing the differences between 2 (text) files (diff <file> <file>)
  • Pull a file off the web without firing up a browser. (wget)
  • Watch the end of a file for changes, such as an application log file. (tail -f <file>)
  • telnet, ssh clients
  • Run an Xwindows client session in Windows. (startx)
  • Tell where an executable will be run from. (which)

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:

  • Download and run setup.exe from cygwin.com.
  • Click through the options [defaults should be ok], and select a download site.
  • You will get a organized list of all the packages that are available. Modify the selected packages as you wish- the more you select, the larger the install footprint.
  • Setup caches what you download so if you want to add a package later, you can do so without downloading the whole system again.

Recommended modifications from the default packages.

  • Add Web/wget – download files off the web from the command line ( script heaven)
  • Add Editors/vim – If you like the vi editor, otherwise skip it

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.

By Eberly Systems 02 May, 2024
West Lawn, PA, May 2, 2024 — Eberly Systems , the West Lawn-based managed IT services and managed voice provider, today announces its acquisition of the Lebanon-based LYLAB Technology Solutions. Eberly Systems seeks to further a movement of people who are motivated and equipped to make a difference in their world through their daily work. They believe in building lasting partnerships based on trust and transparency while delivering industry-leading solutions to support and protect critical business assets. Driven by the principles of people, excellence, integrity, and stewardship, the team prides itself on partnering with companies to securely, reliably, and efficiently grow their businesses. “We cannot be more excited to join forces with the LYLAB team,” comments Kordel Eberly, Eberly Systems President & Founder. “ The integration of LYLAB Technology Solutions into Eberly Systems solidifies our commitment to providing small businesses with unparalleled service and support. We’re proud of this new opportunity to carefully design and manage the IT infrastructure and systems of even more local businesses and communities.” The acquisition solidifies the Eberly Systems commitment to supporting businesses in Lebanon County. Merging the two teams together as one entity offers the collective team the benefit of enhancing capabilities, refining processes, and extending reach to better serve the evolving needs of small businesses in the surrounding area. Future plans include expanding their presence into Lancaster County.
computer help with IT support
By Eberly Systems 16 Jan, 2024
A trusted MSP can be your invaluable strategic partner.
By Eberly Systems 02 Jan, 2024
These 5 key features of Office 365 Business Premium make it essential for businesses to have.
set of keys
By Eberly Systems 19 Dec, 2023
Eberly Systems has been hard at work over the last year in a concerted effort to enhance the security posture of our clients’ information technology environments. Here are the quarterly updates.
construction site
By Eberly Systems 03 Jul, 2023
After years of steady growth, the workforce at a construction development and property management company was becoming increasingly frustrated by disorganized data. Eberly Systems deployed a hybrid cloud storage solution for efficiency and secure data access.
By Nate M. 01 Jun, 2023
SharePoint file storage has both features and limitations that you should be aware of while storing and accessing files. Here's a rundown.
By Nate M. 05 Jan, 2023
These are the Eberly Systems recommendations for creating good passwords in 2023.
By Eberly Systems 15 Dec, 2022
Every business relies on phones and a phone service. In accordance with Eberly Services Managed IT, we offer Managed Voice solutions for both handheld and softphones supported by our stellar sales and help desk teams.
By Eberly Systems 04 Oct, 2022
Eberly Systems is proud to offer new services around managed endpoint detection & response, cloud security, business internet brokerage, and unlimited projects.
By Becky 22 Sep, 2022
Annual fundraisers offer a great opportunity to use company paid volunteer time off.
More Posts
Share by: