public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Useful Cygwinism: "Explorer Here"
@ 2002-06-28  1:12 Gary R. Van Sickle
  2002-06-28  1:20 ` Gary R. Van Sickle
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Gary R. Van Sickle @ 2002-06-28  1:12 UTC (permalink / raw)
  To: Cygwin mailing list

Thought I'd share a neat trick with my fellow Cygwinners that I find extremely
useful, but that's maybe not all that obvious to people, and I've never seen it
mentioned.

The Problem:
You're cd'ing around at the bash command prompt, and you come to a directory
that you want to do some complex file/directory manipulations on; say, delete
all files except three.  That'd be a cinch in Windows' Explorer, but would
require all kinds of typing at the bash prompt.  Who has that kind of time in
this workaday world?  Not this soldier!

The Solution:
A tiny little alias I like to call "Explorer Here".  Add this little gem to your
.bash_profile, and wipe that sweat from your brow my friend!:

# Easy "Explorer Here" command
x()
{
	if [ "${1}" = "" ];
	then
		XPATH=".";
	else
		XPATH="$(cygpath -w "${1}")";
	fi
	explorer $XPATH &
}

Now, at the command prompt all you have to do is type "x" and hit enter, and an
explorer box pops up in your current directory!  AND, if you want to you can
specify the path thus "x /posix/path/here"!  PLUS, it doesn't block, mainly
because I can't think of a reason you'd ever want it to.

But Can It Core A Apple?:
Ohhoho, can it core a apple!  I have used this constantly for many months and
it's never let me down yet.  In fact I use it far more often than "Bash Here".

So that's it.  Seems like this would make a good entry in the User Guide, maybe
under "Setting Up Cygwin/Customizing Bash", or maybe it would be good to create
a "Using Cygwin/Useful Cygwinisms" for cygwin-specific tips and tricks like
this.  David S-B, are you maintaining the User Guide too or just the FAQ?

--
Gary R. Van Sickle
Brewer.  Patriot.


--
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/

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: Useful Cygwinism: "Explorer Here"
@ 2002-06-28  2:56 BStrohhaecker
  2002-06-28 12:11 ` Dave Price
  0 siblings, 1 reply; 27+ messages in thread
From: BStrohhaecker @ 2002-06-28  2:56 UTC (permalink / raw)
  To: cygwin; +Cc: g.r.vansickle

Von: Gary R. Van Sickle [mailto:g.r.vansickle@worldnet.att.net]
Gesendet: Freitag, 28. Juni 2002 06:06

...
> # Easy "Explorer Here" command
> x()
> {
> 	if [ "${1}" = "" ];
> 	then
> 		XPATH=".";
> 	else
> 		XPATH="$(cygpath -w "${1}")";
> 	fi
> 	explorer $XPATH &
> }
...

FWIW, to open 2 windows inside explorer try 'explorer /e,$XPATH &'.

Bernd

--
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/

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: Useful Cygwinism: "Explorer Here"
@ 2002-06-28  8:03 Kilroy, David
  2002-06-28 10:45 ` Gerrit P. Haase
  0 siblings, 1 reply; 27+ messages in thread
From: Kilroy, David @ 2002-06-28  8:03 UTC (permalink / raw)
  To: 'Gerrit P. Haase', Marc Chantreux; +Cc: cygwin

 
> Marc schrieb:
> 
> >>>http://www.metagenia.com/~mchantreux/cygwin.html
> 
> >>>Just :
> 
> >>>$SHELL="/bin/bash"
> 
> >>>[HKEY_CLASSES_ROOT\Directory\shell\Rxvt]
> >>>@="Ouvrir un &Terminal unix"
> >>>[HKEY_CLASSES_ROOT\Directory\shell\Rxvt\command]
> >>>@="d:\\usr\\cygwin\\root\\bin\\rxvt -ls"
> 
> 
> >>Does this enables you to open a shell on folders and on drives?
> 
> > not for drives, in fact ...
> 
> >>Also with the version at my site you get a startup file in the
> >>cygwin root with a call to rxvt like this:
> >>
> >>rxvt -sr -sl 2500 -fg lightblue -geometry 90x30 -bg 
> midnightblue -sb \
> >>  -tn rxvt  -fn "Lucida Console-14" -e /usr/bin/bash --login -i
> 
> 
> > why don't use ~/.Xdefaults ?
> 
> Does this always work (even when calleing without X)?

Yes, it does. It is what I use (and I don't have X installed)

> 
> 
> > is there an uninstaller ?
> 
> Yes, installation is done via default Windows .inf files so it can be
> unistalled with 'Add/Remove Software' from the 
> settings->control panel.
> 

Just to warn you, the (original) uninstaller doesn't remove _all_ registry
keys (on W2K), so the 'rxvt here' on the menu doesn't go away. I sent Gerrit
an 'update' a while ago which fixed that (but also had some other errors
which I have since fixed). Gerrit may or may not have updated the
distribution...
 The update also allowed you to install (and uninstall) multiple command
shells with the same install package. 

Dave.


--
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/

^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <1025237567.25808.ezmlm@cygwin.com>]
* RE: Useful Cygwinism: "Explorer Here"
@ 2002-06-28 14:06 Kilroy, David
  2002-06-28 14:16 ` Gerrit P. Haase
  0 siblings, 1 reply; 27+ messages in thread
From: Kilroy, David @ 2002-06-28 14:06 UTC (permalink / raw)
  To: 'Gerrit P. Haase'; +Cc: 'cygwin@cygwin.com'



> -----Original Message-----
> From: Gerrit P. Haase [mailto:gerrit@familiehaase.de]
> Sent: Friday, June 28, 2002 11:02 AM
> To: Kilroy, David
> Cc: Marc Chantreux; cygwin@cygwin.com
> Subject: Re: Useful Cygwinism: "Explorer Here"
> 
> 
> David schrieb:

>  
> 
> > Just to warn you, the (original) uninstaller doesn't remove 
> _all_ registry
> > keys (on W2K), so the 'rxvt here' on the menu doesn't go 
> away. I sent Gerrit
> > an 'update' a while ago which fixed that (but also had some 
> other errors
> > which I have since fixed). Gerrit may or may not have updated the
> > distribution...
> >  The update also allowed you to install (and uninstall) 
> multiple command
> > shells with the same install package. 
> 
> These updates are pointing in the right direction but they were not
> exactly what I would like to see.  Also I cannot confirm that 
> I'm having
> errors on my two boxes (NT4 & W2K).

I meant that I introduced errors in my update, which I have subsequently
corrected in my own files. I assumed that if you integrated my updates, you
would notice and correct the (obvious) errors yourself, and not appreciate
lots of 'and heres another fix' emails.

As for the updates not being quite what you'd like... well I can't do
anything about that :)



Dave.


--
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/

^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <1025333888.1042.ezmlm@cygwin.com>]

end of thread, other threads:[~2002-07-03  7:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-28  1:12 Useful Cygwinism: "Explorer Here" Gary R. Van Sickle
2002-06-28  1:20 ` Gary R. Van Sickle
2002-06-28  1:57 ` Dave Price
2002-06-28  2:10   ` Gerrit P. Haase
2002-06-28  2:58     ` Marc Chantreux
2002-06-28  3:22       ` Gerrit P. Haase
     [not found]         ` <3D1C353C.80606@wanadoo.fr>
2002-06-28  5:30           ` Gerrit P. Haase
2002-06-28 10:20             ` Marc Chantreux
2002-06-28 11:08         ` Nicholas Wourms
2002-06-28  3:17 ` Michael Schaap
2002-06-28  4:56   ` Marc Chantreux
2002-06-28  5:25     ` Michael Schaap
2002-06-28  6:02 ` Robert Collins
2002-06-29  8:12   ` Gary R. Van Sickle
     [not found]   ` <NCBBIHCHBLCMLBLOBONKGEPIDAAA.g.r.vansickle@worldnet.att.ne t>
2002-06-29 13:00     ` Jonathon M. Merz
2002-06-28  2:56 BStrohhaecker
2002-06-28 12:11 ` Dave Price
2002-06-28 12:22   ` Useful cygwinism: " Christopher Faylor
2002-06-28 13:21     ` Bernard A Badger
2002-06-28 15:07       ` Gerrit P. Haase
2002-06-28 13:50     ` Gerrit P. Haase
2002-06-28  8:03 Useful Cygwinism: " Kilroy, David
2002-06-28 10:45 ` Gerrit P. Haase
     [not found] <1025237567.25808.ezmlm@cygwin.com>
2002-06-28  9:13 ` Joshua Daniel Franklin
2002-06-28 14:06 Kilroy, David
2002-06-28 14:16 ` Gerrit P. Haase
     [not found] <1025333888.1042.ezmlm@cygwin.com>
2002-07-03  0:58 ` Useful cygwinism: " Reini Urban

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).