Unix Tools on Windows

Andrew Hallam | | 8 November 2006, 05:16

On Windows 2000, I needed to get a list of all files, including their paths, from a directory containing multiple subdirectories. dir /S > /temp/filelist.txt listed each directory and then each file in that directory. I didn’t like the thought of manually removing all the cruft and creating filepath/filename.ext for 999 files, so I installed UnxUtils.

print -l **/*(.) > /temp/filelist.txt was all I needed. Plus, I got a shell with got tab completion, and access to lots of the commonly used Unix tools.

There are other similar free toolsets out there, like UWin, but UnxUtils was simple to install. Just add the wbin directory to your path.

Ironically, a bit more research tonight reveals that dir /S /B > /temp/filelist.txt might do the job (will test it tomorrow), but it’s still nice to have Unix style shell.

Update: dir /S /B > does list the full path to all files within and below the current directory, with no extraneous text. However, it also includes a line for each directory. Close, but not exactly what I wanted.

Comments [1] »

  1. Thanks for the info. I've always used the UNIX tools from a GIS course I took way back (the instructor was a UNIX advocate; woo hoo!) -- see http://elearning.algonquincollege.com/coursemat/viljoed/gis8746/lecture.html under "Week 10"

    Tom Kralidis 9 November 2006, 21:47

Commenting is closed for this article.

|

Powered by Textpattern | Tranquility White made TXP-ready by Textpattern Templates