Cygwin copy/paste to Windows (and vice-versa

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Cygwin copy/paste to Windows (and vice-versa

Postby dedanna1029 » 09 Oct 2015, 22:12

For Cygwin, there is documentation online about how to access Windows files (outside the Cygwin environment). This documentation doesn't say much at all about copying/pasting to the Windows environment from Cygwin, the documentation states mostly about how to just access files on your c:\ drive.

To copy files from Cygwin to the c:\ drive, we want to keep in mind that Cygwin names your c:\ drive in Windows as: /cygdrive/c.

First what we want to do, is create a symlink (short for symbolic link) to the c:\ drive by pulling up a terminal in Cygwin and do:

Code: Select all

ln -s /cygdrive/c /c

Then, it's just a matter of changing directory in Cygwin to the files that you want to copy to your c:\ drive in Windows. For me in this case it was:

Code: Select all

cd /home/dedanna/Downloads/Core-Release-1

Next, it's the regular copy command to the directory in c:\ that you want the files copied to:

Code: Select all

cp *.* /c/Users/dedanna/Downloads/linux-updates/core-release


Since I'd made the symbolic link first, I didn't have to type /cygdrive/c, just /c, and my files are right where I wanted them. :A

Image

There are those saying that one can use just c:\<folder> now, but I prefer this method; it keeps me in the same context when I'm in Cygwin. :)
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

Return to “Tips & Tricks”