X-Spam-Check-By: sourceware.org Date: Thu, 4 Jan 2007 12:26:25 -0500 (EST) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Rex Godby cc: cygwin AT cygwin DOT com Subject: Re: Two short scripts for Cygwin-Windows interoperation In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Thu, 4 Jan 2007, Rex Godby wrote: > Two tiny Cygwin shell scripts may be of use. Each script has a single > active line, which I include here (to try these from the command line, > of course replace $1 with your desired argument): > > 1. To quickly find files and directories in "My Documents" and Desktop > (down to a certain depth): > > find "/cygdrive/c/Documents and Settings/$USER/Desktop" \ > "/cygdrive/c/Documents and Settings/$USER/My Documents" \ > -maxdepth 3 | grep "$1" FYI, while "Documents and Settings" is the prevailing name, that directory could have any other name (and does, in non-English versions of Windows). The Desktop path can be obtained in a general way by "`cygpath -uD`". Unfortunately, there is no such ready shortcut for "My Documents", though "`cygpath -uH`/$USER/My Documents" should work for most installations of the English versions of Windows. Also, it's almost always faster to run 'find ... -path "*$1*"' than it is to run 'find ... | grep "$1"'. > 2. To open an Explorer window in a specified directory (given in Cygwin > style), or to open a document in the proper Windows application: > > /cygdrive/c/WINDOWS/explorer `cygpath -w "$1"` Or 'cygstart "$1"', where "$1" is a directory. HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Freedom is just another word for "nothing left to lose"... -- Janis Joplin -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/