If I write echo $PATH in my Cygwin window (mintty) I get a list of paths. That list does not match the Windows Envirnonement variables list. I cannot find a file, where is the variable $PATH set. None of the ~/.* files like .bashrc, .bash_profile, .profile, .inputrc, .minttyrc contain $PATH setting.
So, where is the variable $PATH actually set?

  • there's indications that the default path is "/usr/bin:/bin" -- is that what you're seeing? – Jeff Schaller Oct 15 '18 at 17:03
  • there could be files like /etc/profile, but doesn't cygwin start with converting the DOS PATH variable? – Gerard H. Pille Oct 15 '18 at 17:07

For bash the PATH is set initially in /etc/profile

  # Setup some default paths. Note that this order will allow user installed
  # software to override 'system' software.
  # Modifying these default path settings can be done in different ways.
  # To learn more about startup files, refer to your shell's man page.

  if [ ${CYGWIN_NOWINPATH-addwinpath} = "addwinpath" ] ; then

By default it includes the Windows PATH

If you need to modify it the best place are .bash_profile and .bashrc



The PATH is initially inherited from the Windows PATH environment variable with minor changes \ character -> / character. Consider modifying /etc/profile as the first best choice. Before you do anything the very first time: export PATH=/bin:/usr/bin:${PATH}

so you can access the cygwin UNIX tools. To set /etc/profile up as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.