LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2013, 03:21 AM   #1
Bryzey
LQ Newbie
 
Registered: Aug 2013
Posts: 11

Rep: Reputation: Disabled
Copying Files From My Laptop To My External HDD That Is Connected To Raspberry PI


Hi All,

Very new to Linux and trying to switch from GUI to CLI for getting things done.

Currently I can just drag the files across from the Laptop to the PI using GUI but I am trying to learn the command line so hopefully someone can help me out.

scp home/brian/testfile root@ipadress: /var/media/My\ Book/

Whenever I try this command I keep getting an error message:

scp: ambiguous target

What I am missing here? Is it something to do with the mounted HDD?

Thanks!

Last edited by Bryzey; 08-28-2013 at 03:25 AM.
 
Old 08-28-2013, 03:28 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

there should not be any space between the colon and the destination path. Ie, try
Code:
scp home/brian/testfile root@ipadress:/var/media/My\ Book/
HTH,

Evo2.
 
Old 08-28-2013, 03:30 AM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
ipaddress is a 'place holder' you need to enter the IP address of your Pi

example root@192.168.0.5

some other things you may like to look at

sftp , rsync and sshfs


Doh,
totally missed the : ( lack of )

Last edited by Firerat; 08-28-2013 at 03:31 AM.
 
Old 08-28-2013, 03:35 AM   #4
Bryzey
LQ Newbie
 
Registered: Aug 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks evo2.

That was one of the two problems.

The other problem is that I did not have the /var/media/My\ Book/ in quotes.

Here is the working command in the end.

Code:
scp home/brian/testfile root@ipadress:"/var/media/My\ Book/"
 
Old 08-28-2013, 03:43 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

since you escaped the space in "My Book" (using the backslash) I'm surprised that you needed the quotes... but I generally don't have spaces in file or directory names, and I typically use rsync instead of scp. Anyway good luck on the command line and welcome to LQ.

Evo2.
 
Old 08-29-2013, 12:27 PM   #6
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC23, Raspbian, Ubuntu Precise via Chrome/Crouton
Posts: 355

Rep: Reputation: 42
Quote:
Originally Posted by evo2 View Post
Hi,

since you escaped the space in "My Book" (using the backslash) I'm surprised that you needed the quotes... but I generally don't have spaces in file or directory names, and I typically use rsync instead of scp. Anyway good luck on the command line and welcome to LQ.

Evo2.
Yes, I found that on a remote scp target, you have to double-escape whitespace/wildcard characters. The first escape, in this case the quotes, was to prevent whitesapce processing on the originating system and have it send the destination string to the target system. The second escape, in this case the backslashes, is observed on the target system.
 
  


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
Linux recognizes external HDD connected via eSATA but not via USB hypernetics Linux - Hardware 2 12-07-2012 09:25 AM
Fedora 13 copying data very slowly to external HDD n03x3c Fedora 4 06-27-2010 12:31 AM
Recommend CLI software for copying data from dying external HDD? peter3731 Linux - Software 3 09-27-2008 12:42 PM
I/O error while copying some data on to external HDD gary4gar Linux - Hardware 2 10-31-2007 04:50 AM
booting machine with linux on an external HDD without HDD connected drsoum Linux - Newbie 2 07-22-2007 04:47 AM


All times are GMT -5. The time now is 06:03 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration