LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2014, 05:12 AM   #1
yogesh_attarde
Member
 
Registered: Jan 2010
Posts: 82

Rep: Reputation: 1
scp from linux to windows machine through cygwin not working


Hi All,

I am facing issue in coping files with scp from linux to windows through cygdrive. Please go through the below problem description.

When I try to copy files from Linux machine using below command, it says no such file or directory, while the file is exists at the location.

Code:
scp tmp.txt Yogesh@paravai:/cygdrive/c/temp
I tried to copy file using below command.

Code:
scp tmp.txt Yogesh@paravai:\cygdrive\c\temp
The files gets copied at my home directory with "cygdrivectemp" name. while expected result is file should gets copied at \cygdrive\c\temp with tmp.txt name.

Also when I am doing scp from cygwin file gets copied successfully.

Code:
scp root@hostname:/tmp/tmp.txt .
When I Google it I found that this might be because of git repository executables were used instead of cygwin. I have installed sshd on cygwin.

I know I can copy files with winscp but for some reason I have a requirement of cygwin and test few more things in cygwin.

Please help me to resolve this as I this is very urgent.


Thanks,
Yogesh

Last edited by yogesh_attarde; 03-26-2014 at 05:14 AM.
 
Old 03-26-2014, 07:30 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,468

Rep: Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799Reputation: 2799
The command
Quote:
scp tmp.txt Yogesh@paravai:\cygdrive\c\temp
is subject to interpretation by the shell in which it is executed. The actual command will be interpreted as
Quote:
scp tmp.txt Yogesh@paravai:cygdrivectemp
which causes the creation of the file that you observed.
Try
Code:
scp tmp.txt Yogesh@paravai:\\cygdrive\\c\\temp\\
instead.
 
Old 03-27-2014, 06:17 AM   #3
yogesh_attarde
Member
 
Registered: Jan 2010
Posts: 82

Original Poster
Rep: Reputation: 1
Thanks Allend for your reply.

I've traced the bulk of my problems to be a result of the installation of MSYSGit that is on the system. It has its own set of Unix-like utilities that do not play well with Cygwin.

As a first step, I went onto paravai and inserted a c:\cygwin64\bin in front of c:\Program Files\Git\bin in the PATH variable.

This fixed almost all of my problems with respect to paths being interpreted correctly from the Unix utilities.


Regards,
Yogesh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SCP: Copy file from remote linux server onto a windows machine? Tony Empire Linux - Newbie 21 09-22-2015 11:18 PM
Any SCP client (on Windows/Cygwin) support UTF-8 encoding of filenames? drroot Linux - Software 3 01-04-2011 01:47 PM
SCP to windows with cygwin Bth8 Linux - Networking 1 04-14-2009 11:17 AM
'Having whatever Linux' working like cygwin under MS-Windows ?? Xeratul Linux - Software 2 06-04-2007 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration