delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/04/12:26:39

X-Spam-Check-By: sourceware.org
Date: Thu, 4 Jan 2007 12:26:25 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Rex Godby <rwg3 AT york DOT ac DOT uk>
cc: cygwin AT cygwin DOT com
Subject: Re: Two short scripts for Cygwin-Windows interoperation
In-Reply-To: <loom.20070104T172439-137@post.gmane.org>
Message-ID: <Pine.GSO.4.63.0701041220120.15041@access1.cims.nyu.edu>
References: <loom DOT 20070104T172439-137 AT post DOT gmane DOT org>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019