Setting default path with Cygwin

14,811

Solution 1

In your ~/.bashrc, You can either change your $HOME to that directory, or you can [tried and it didn't work] add a cd to that directory at the end of the file.

Solution 2

In your ~/.bash_profile you may simply write cd /cygdrive/c/path/to/where/you/want/cygwin/to/start. You will find this file in your cygwin installation folder, under <path_to_cygwin>\home\<user>\.bash_profile. (In my case: C:\cygwin64\home\User\.bash_profile).

Share:
14,811
Puppy
Author by

Puppy

Updated on June 19, 2022

Comments

  • Puppy
    Puppy almost 2 years

    I've got a Cygwin installation, and I'd like it to start Bash in a certain directory whenever I start up. How can I achieve this?

  • Puppy
    Puppy over 12 years
    Where and what the hell is a ~/.bashrc? Edit: The whole file appears to be a gigantic comment.
  • Kevin
    Kevin over 12 years
    ~ is a shortcut for your home directory, which is where you log in. It's usually /home/username where username is your actual username. .bashrc is a file that bash reads when you log in to set up the environment the way you want it.