how to change dir

View: New views
12 Messages — Rating Filter:   Alert me  

how to change dir

by bench33 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In bash, how do you change to another directory?

I see that the only directory I can go is home (c:\cygwin)

I have other physical drives (d:\). How do I go there?


Thanks!

Re: how to change dir

by Mark J. Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, May 5, 2008 at 4:40 PM, bench33 <bench_warmer2003@...> wrote:
>  In bash, how do you change to another directory?
>
>  I see that the only directory I can go is home (c:\cygwin)
>
>  I have other physical drives (d:\). How do I go there?

Cygwin apps (including bash) don't understand drive:paths.  Use

cd /cygdrive/d/

You can let the cygpath utility do the conversion for you:

cd "$(cygpath 'd:\')"

--
Mark J. Reed <markjreed@...>

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


Re: how to change dir

by rogerwells :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Mark J. Reed wrote:

> On Mon, May 5, 2008 at 4:40 PM, bench33 <bench_warmer2003@...> wrote:
>  
>>  In bash, how do you change to another directory?
>>
>>  I see that the only directory I can go is home (c:\cygwin)
>>
>>  I have other physical drives (d:\). How do I go there?
>>    
>
> Cygwin apps (including bash) don't understand drive:paths.  Use
>
> cd /cygdrive/d/
>
> You can let the cygpath utility do the conversion for you:
>
> cd "$(cygpath 'd:\')"
>
>  
cd c:/windows
works fine, note forward slash

--
Roger Wells, P.E.
SAIC
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.wells@...


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


Re: how to change dir

by Lee Maschmeyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or you can use the Cygwin mount command. It took me several years(!) to
realize the power of this utility. You need do it only once because they're
permanent until you change them:

mount d:\ /d
cd /d

By the way, c:\cygwin is /. /home is c:\cygwin\home\<your_ID>

--
Lee Maschmeyer
Computing Center Services
Computing and Information Technology
Wayne State University
Detroit, Michigan, USA



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


Re: how to change dir

by DRLDR :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lee Maschmeyer wrote:
> Or you can use the Cygwin mount command. It took me several years(!)
> to realize the power of this utility. You need do it only once because
> they're permanent until you change them:

cd 'x:\any windows\path will also\work'

I do it all the time when "switching between" a windoze app path and an
existant cygwin window.


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


Re: how to change dir

by Mark J. Reed-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, so I was totally wrong about Windows paths not working.  I guess
the OP was running into quoting issues. So the answer: put single
quotes around the pathname when using it in bash.



On 5/5/08, Lee D. Rothstein <lee@...> wrote:

> Lee Maschmeyer wrote:
> > Or you can use the Cygwin mount command. It took me several years(!)
> > to realize the power of this utility. You need do it only once because
> > they're permanent until you change them:
>
> cd 'x:\any windows\path will also\work'
>
> I do it all the time when "switching between" a windoze app path and an
> existant cygwin window.
>
>
> --
> 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/
>
>

--
Sent from Gmail for mobile | mobile.google.com

Mark J. Reed <markjreed@...>

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


Re: how to change dir

by bench33 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thank you so much everyone!!!

Re: how to change dir

by Yaakov (Cygwin/X) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Lee D. Rothstein wrote:
| cd 'x:\any windows\path will also\work'

Or you can escape the backslashes and spaces. e.g.:

cd x:\\any\ windows\\path\ will\ also\\work


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkgf1lMACgkQpiWmPGlmQSMn8gCfY1rVvzkwyf3LIgmL8p1vOuvw
SL4AoPu96fV8EdFW7NnDgqAKOsASJKYK
=ceZr
-----END PGP SIGNATURE-----

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


Re: how to change dir

by Christopher Faylor-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, May 05, 2008 at 08:13:27PM -0400, Lee D. Rothstein wrote:
> Lee Maschmeyer wrote:
>> Or you can use the Cygwin mount command. It took me several years(!) to
>> realize the power of this utility. You need do it only once because
>> they're permanent until you change them:
>
> cd 'x:\any windows\path will also\work'
>
> I do it all the time when "switching between" a windoze app path and an
> existant cygwin window.

Note that this will give you a warning in Cygwin 1.7 since you are using
non-POSIX path names.

cgf

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


Re: how to change dir

by DRLDR :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christopher Faylor wrote:

> On Mon, May 05, 2008 at 08:13:27PM -0400, Lee D. Rothstein wrote:
>  
>>
>> cd 'x:\any windows\path will also\work'
>>
>>    
> Note that this will give you a warning in Cygwin 1.7 since you are using
> non-POSIX path names.
>
>  
I do hope there will be an option with an alternative environment
variable setting that will direct the warning to /dev/null ?

The credo of Cygwin, it seems to me, has always been:

Give Windoze users a shot at the richness and wisdom of GNU/UNIX without
making their lives any more miserable than MBRH (Mr. Bill and the
Redmond Hordes) has already done.

NOT POSIXlee, yours ;-)

Lee Rothstein

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


Re: how to change dir

by Christopher Faylor-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, May 06, 2008 at 01:32:47PM -0400, Lee D. Rothstein wrote:

> Christopher Faylor wrote:
>> On Mon, May 05, 2008 at 08:13:27PM -0400, Lee D. Rothstein wrote:
>>  
>>>cd 'x:\any windows\path will also\work'
>
>>Note that this will give you a warning in Cygwin 1.7 since you are
>>using non-POSIX path names.
>
>I do hope there will be an option with an alternative environment
>variable setting that will direct the warning to /dev/null ?

You could try it and see:
http://cygwin.com/snapshots/

>The credo of Cygwin, it seems to me, has always been:
>
>Give Windoze users a shot at the richness and wisdom of GNU/UNIX
>without making their lives any more miserable than MBRH (Mr.  Bill and
>the Redmond Hordes) has already done.

Cygwin's goals are more-or-less summarized in the first few sentences on
the web site.

While it may be possible now to use Cygwin without understanding what
POSIX paths are or what Linux is, it is not a primary goal of the
project to make MS-DOS path names work transparently.  The fact that
they do work in most cases is fortunate but it is not a primary goal.
And, in many cases people get into trouble using MS-DOS paths because
they don't understand that the tools prefer POSIX.

cgf

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


Re: how to change dir & POSIX

by DRLDR :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christopher Faylor wrote:

 >>> Note that this will give you a warning in Cygwin 1.7 since you are
 >>> using non-POSIX path names.

 >> I do hope there will be an option with an alternative environment
 >> variable setting that will direct the warning to /dev/null ?

 > You could try it and see:

 > http://cygwin.com/snapshots/

I appreciate the offer. However, I've had so much trouble with Vista
(especially with Cygwin) that I'll wait till I don't need two configs.

 >> The credo of Cygwin, it seems to me, has always been:

 >> Give Windoze users a shot at the richness and wisdom of GNU/UNIX
 >> without making their lives any more miserable than MBRH (Mr.  Bill and
 >> the Redmond Hordes) has already done.

 > Cygwin's goals are more-or-less summarized in the first few sentences on
 > the web site.

 > While it may be possible now to use Cygwin without understanding what
 > POSIX paths are or what Linux is, it is not a primary goal of the
 > project to make MS-DOS path names work transparently.  The fact that
 > they do work in most cases is fortunate but it is not a primary goal.
 > And, in many cases people get into trouble using MS-DOS paths because
 > they don't understand that the tools prefer POSIX.

I fully understand POSIX paths, 'mount's, 'ln' links, 'cygpath',
'chere', etc. (And BTB, IMHO, the GNU folks have been right more
often than the IEEE folks [POSIX] about how UNIX/GNU/Linux should
work. So, any attempts to enforce POSIX would fall on deaf ears
in my case [and I'm an ex-officer of IEEE]. Can't we turn on and
off POSIX correctness with a 'bash' switch?)

And too, I understand and agree with your point about Cygwin
users needing to understand the differences between Windoze and
GNUish paths of any "sect".

My point was:

  Cygwin rocks.
 
  At times, on Windoze, my work requires me to go between the
  native Win GUI apps and Cygwin terminal/console windows,
  intermittantly, as might also be the case with the other users
  (including a newbie) to which my response was directed.

  In such case, it's handy to be able to:

  cd 'x:\any windows\path will also\work'

  having copied "x:\any windows\path will also\work" from the path
  box of Explorer, or another WinGUI app.

  In the other direction:

  I wrote a script that "Windozes" the clipboard path:
  --
  #!/usr/bin/bash

  # wp: convert GNUish Path on Clipboard to Windows format

  cygpath --windows "$(getclip)"|putclip
  --
  Of course, after I do the copy to the clipboard, I must enter
  'wp' at a Cygwin prompt, before I paste the path into a Win GUI
  app "box".

  Actually, I've rethought my initial request--that you responded
  to--and realize that I could always handle the problem with a
  script/function of my own. So, as the esteemed Emily Letella
  used to say, "Never Mind!" [We miss you, Gilda.]
 
  However, even that approach requires that Windows paths are
  understood in perpetuity (of the Cygwin development).

  If that is not the case, it will make the usefulness of Cygwin
  to me, quite a lot less than it has been.
 
  Cygwin Rocks (if you have to live with Windoze)! (If you have a
  Mac, /for example/, you don't need Cygwin because the base
  platform is BSD!)


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