Unix Utils for Windows
I work with unix operating systems quite a bit. So when I'm using Windows I'm often missing some of the handy little command line unix tools that are ubiquitous to unix but no where to be found on Windows.
Just today I was wanting to use the GNU find utility. The find command on unix lists all the files in a directory recursively. Its really handy because if you need to find out where a file is you just type find /path | fgrep search.file. One thing that frustrates me about the Windows search is that you have to search an entire drive - if I know the file I am looking for is in c:\windows why should I have to search the entire c:\ drive?
So I came across some Native Win32 Ports of some GNU utilities, such as find, grep (as well as fgrep, and egrep). These are nice because you can run them right from the windows command line, so no need to run in an emulator like cygwin.
One thing you need to keep in mind is that some of these utilities might have the same name as some windows utilities, you probably better off renaming these in the case of conflict. For instance Windows comes with a program called find.exe that searches for text inside a file, so I renamed the GNU find to xfind.exe.
Tweet
Related Entries
- Top 20 Internet Security Vulnerabilities of 2005 - November 23, 2005
- Cheat Sheet Roundup - Over 30 Cheatsheets for developers - September 1, 2005
- SSH for Windows - December 6, 2004
- xcopy - Handy tool on windows - December 9, 2003
- FTP Scripts on windows - February 1, 2003
Trackbacks
Comments
Your reason to use unix utils is pointless at all. If it is that you can not read or use Windows it is not the right reason.
BTW I use them also but not for simple things that can be done by windows utils.
Pete was obviously just trying to give a simple example of a more elegant way of doing things. Have you nothing better to do than nit-pick? Who needs a "right reason" to use tools which are more powerful and they are, personally, more comfortable with?
As you may know or not, the 'dir' command on DOS does the same. You just have to read something called HELP (yes it is a command, try HELP DIR), and you'll see that "dir /o/s/b <pattern>" will look for pattern in current dir and its subdirectories...
As a matter of fact you can right click on the folder you want to begin the search and select search. But I haven't found the win search as reliable ..
find /path -name search.file or find /path -name search.\*
UNIX find can pattern match, filter by type, etc. Windows' "find" is more like UNIX's grep command.
As for the rest of you that suggest using the GUI to find files, you have completely missed the point - the original post is talking about a command line interface, not a GUI. I don't know what the original poster needed to accomplish, but I use find on UNIX as part of a tool-chain to perform more complex tasks, a GUI interface is useless in that context.
In short, nobody can credibly argue that Windows' command line commands are in the same league as those found in UNIX. UNIX (Linux is a flavor of UNIX) was designed as a "workbench" OS, prior to wide spread use of GUI's, probably before GUI's were invented.
Post a Comment
Recent Entries
- Nginx redirect www to non www domain
- HashDOS and ColdFusion
- HackMyCF Updated for APSB11-29 Security Hotfix
- Adobe eSeminar on FuseGuard
- Determining Which Cumulative Hotfixes are Installed on ColdFusion
- Adding Two Factor Authentication to ColdFusion Administrator
- ColdFusion Developer Week at Adobe.com
- Bug Loading Scripts for CFFileUpload and CFMediaPlayer


add to del.icio.us


