Fog Creek Software
Discussion Board




windows shell equivalent of find -ls

I need to generate a text listing of all the files in a windows directory. I.e.:

C:\stuff\textfile.txt
C:\stuff\textfile2.txt
C:\stuff\subdir\anotherfile.doc
C:\stuff\subdir\blablabla.xls


In UNIX, I would cd into the directory i want and then type
"find -ls"

what is the quickest way to do this on a windows (XP) machine?

thanks!

zdfn
Monday, October 06, 2003

If you mean quickest as in easiest/simplest, cd to the directory and then do a "dir /s /b".  The /s means expand all subdirectories, the /b means "bare" or "raw" filenames - no per-directory summary information, file sizes, timestamps, etc.

schmoe
Monday, October 06, 2003

dir /b /s

check dir /?

Li-fan Chen
Monday, October 06, 2003

dir <dirname> /b /s


example:
dir c:\winnt /b /s

Li-fan Chen
Monday, October 06, 2003

sweet! that's just what i needed. thanks!!!

zdfn
Monday, October 06, 2003

while I'm still here and too lazy to RTFM, is there a flag to exclude directory directory listings?

i.e. instead of getting:

c:\stuff\subdir
c:\stuff\othersubdir
c:\stuff\othersubdir\textfile.txt
c:\stuff\othersubdir\anothersubdir
c:\stuff\othersubdir\anothersubdir\anothertextfile.txt

i get:
c:\stuff\othersubdir\textfile.txt
c:\stuff\othersubdir\anothersubdir\anothertextfile.txt

?

thanks again!

zdfn
Monday, October 06, 2003

dir /b /s /a-d      RTFMed. thanks again!!

zdfn
Monday, October 06, 2003

Install cygwin and run 'find' as normal, including any 'xargs' foo you've accrued over the years.

Chris Winters
Monday, October 06, 2003

You don't have to RTFM. Most shell commands with a -? on them will give you a quick syntax help.

Troy King
Monday, October 06, 2003

You know what? Please don't bring your weirdo tools to our excellent Windows environment!

WinJack
Monday, October 06, 2003

>Winjack

*lmao*

Li-fan Chen
Monday, October 06, 2003

Those Win32 ports of *nix utilities are all that make the command prompt in WinXP even remotely useful to me.

anonymouse
Monday, October 06, 2003

*  Recent Topics

*  Fog Creek Home