Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <5.1.0.14.2.20020706074502.01b49ae0@pop3.cris.com> X-Sender: rrschulz AT pop3 DOT cris DOT com Date: Sat, 06 Jul 2002 07:56:26 -0700 To: "Hari Turlapati" , cygwin AT cygwin DOT com From: Randall R Schulz Subject: Re: ls -R doesn't work; V1.3.12 on Win2000 In-Reply-To: <000901c22458$419aef30$9e00100a@HTURLAPATI> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Hari, What are you trying to do, exactly? Unless there's problem local to your system, "ls" and its "-R" option work just fine--I use them all the time, as do many others. Your description of the "symptoms" suggest that your "ls" and related Cygwin facilities are working correctly. Here's what you're command is asking the software to do: List all the file system entities in the current directory whose names end in ".doc". For all such entities that happend to be directories, also list their content recursively. Include "hidden" entries (those whose name starts with ".") in the listing and produce a "long" style listing. If you want to list all the files within a sub-hierarchy of the file system that meet some criteria (name patterns, e.g.) you must involve the "find" command. So, here's a shot at what you want: ls -ld $(find -iname "*.doc") If you're not using BASH, use this syntax instead: ls -ld `find -iname "*.doc"` If you want both ".doc" and ".pdf" files, this will work: ls -ld $(find -iname "*.doc" -o -iname "*.pdf") If there are very many files (technically, if the number of characters of output produced by "find" exceeds a built-in limit), this will fail and you'll need to use the "xargs" command to overcome that limitation. Find is very sophisticated and can select files based on many criteria in arbitrary combinations. For example, it can find files based on regular expressions, too (the patterns used in the "-name" and "-iname" are shell "glob" expressions, not regular expressions). Read the man page. If I misunderstand your intent, please forgive me and let me know what it was you're attempting. Randall Schulz Mountain View, CA USA At 12:14 2002-07-05, Hari Turlapati wrote: >The command "ls -laR *.doc" (Recursive listing of *.doc or *.pdf or >*.rtf, in general files with specific extension) under a subdirectory to >/cygdrive/c/ doesn't work. Even "ls -laR *.*" doesn't work. > >But "ls -laR *" lists all the files under the subdirectories. > >I am using CygWin Release 1.3.12-1 on Win2000 OS. The command "uname -a" >on my machine prints out the following: > >CYGWIN_NT-5.0 HariPC 1.3.12(0.54/3/2) 2002-07-03 16:42 i686 unknown > >Thanks > >Hari -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/