How can I create a Cygwin shortcut that will open Cygwin at a specific folder? This would obviate having to type
cd /cygdrive/c/Users/Tom/Desktop/
Here's what I use. It doesn't require chere
package or registry tinkering. Works on Windows 7.
Go to your "Send To" folder:
C:\Users\\AppData\Roaming\Microsoft\Windows\SendTo
Create a shortcut named Bash Here
having this in the Target
field:
C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico C:\cygwin\bin\bash.exe -l -c "cd \"$0\" ; exec bash"
In the Windows Explorer, you right-click on a folder & select Send To > Bash Here
.
And here's the opposite trick, opening a Windows Explorer in your current bash dir. Create this alias:
alias winx='/cygdrive/c/Windows/explorer.exe /e,\`cygpath -w .\`'
Note: the cygpath -w .
part above is enclosed in back-ticks.
Now just type winx
at the bash prompt, and a Win Explorer pops up there.
Note: If winx directs you to your documents folder, try
alias winx='/cygdrive/c/Windows/explorer.exe /e,`cygpath -w $PWD`'