scp specific files

Status
Not open for further replies.

anneranch

Active Member
Joined
Mar 16, 2019
Messages
223
Reaction score
43
Credits
2,078
I am trying to copy specific files from one OS to another.
I have two major issues using scp.

This syntax alone creates another folder - resulting in /usr/lib/arm-linux-gnueabihf/arm-linux-gnueabihf - on the destination and copies "stuff" to it until I stop it ( I think -r is part ot the issue )

sudo scp -r [email protected]:/usr/lib/arm-linux-gnueabihf/ /usr/lib/arm-linux-gnueabihf/

That is not of a majoir isse - I cam move the desired files around later.

What I really want is to scp specific files such as *bluetooth" .
I do not know how to option scp to do that .



qw@qw-desktop:/usr/lib/arm-linux-gnueabihf$ sudo scp [email protected]:/usr/lib/arm-linux-gnueabihf/libbluetooth* /usr/lib/arm-linux-gnueabihf/
[email protected]'s password:
scp: /usr/lib/arm-linux-gnueabihf: not a regular file
cp: cannot stat 'libbluetooth*': No such file or directory
qw@qw-desktop:/usr/lib/arm-linux-gnueabihf$ sudo scp [email protected]:/usr/lib/arm-linux-gnueabihf/ *libbluetooth* /usr/lib/arm-linux-gnueabihf/
[email protected]'s password:
scp: /usr/lib/arm-linux-gnueabihf: not a regular file
cp: cannot stat '*libbluetooth*': No such file or directory
qw@qw-desktop:/usr/lib/arm-linux-gnueabihf$
 


Can you send output of
ls -l /usr/lib/arm-linux-gnueab*

Also possibly the output of

file /usr/lib/arm-linux-gnueabihf

It appears you are trying to send a directory, not a file.
 
I think you may either need to escape the asterisk using a backslash \* or use single, or double quotes around the path/filename.
e.g.
Escaping the asterisks with a backslash:
Bash:
sudo scp -r [email protected]:/usr/lib/arm-linux-gnueabihf/\*libbluetooth\* /usr/lib/arm-linux-gnueabihf/

Or using single quotes:
Bash:
sudo scp -r '[email protected]:/usr/lib/arm-linux-gnueabihf/*libbluetooth*' /usr/lib/arm-linux-gnueabihf/

Or double quotes:
Bash:
sudo scp -r "[email protected]:/usr/lib/arm-linux-gnueabihf/*libbluetooth*" /usr/lib/arm-linux-gnueabihf/

I'm not 100% certain, but I'd imagine that at least one, if not all of these will work for you!
 
Your remote host/server won't give you access to /usr/lib (it's root-owned) so it "doesn't exist" to the client coz it's invisible to the client.

Edit: I see you did authenticate yourself. My bad, didn't read the OP properly, just saw "No such file or directory"...
"Assumption is the mother of all fckups" lol.
 
Last edited:
Can you send output of
ls -l /usr/lib/arm-linux-gnueab*

Also possibly the output of

file /usr/lib/arm-linux-gnueabihf

It appears you are trying to send a directory, not a file.

I actually wanted to scp the directory first
But
the command created another directory / folder and would not stop by itself.
I am go9ing to take a shortcut and link to /usr/lib/arm-linux-gnueabihf:
to see if it contains the file I need to link to.
ADDENDUM
I did this instead , it is pretty long but it does contain the fikle I need
Can somebody tell what "total" of ??
Please not the extra folder created on first line - do not need that

I WILL DELETE THE OUPUT IN A DAY OR SO !
sorry it WONT LE ME POST MESSAGE THIS long
qw@qw-desktop:~$ ls -l /usr/lib/arm-linux-gnueabihf/*
total 554888
drwxr-xr-x 74 root root 20480 Oct 18 20:00 arm-linux-gnueabihf
drwxr-xr-x 2 root root 4096 Oct 18 19:57 audit
drwxr-xr-x 2 root root 4096 Oct 18 19:57 avahi

drwxr-xr-x 4 root root 4096 Oct 18 20:01 vlc
qw@qw-desktop:~$





qw@qw-desktop:~$ ls -l /usr/lib/arm-linux-gnueab*
/usr/lib/arm-linux-gnueabi:
total 8
drwxr-xr-x 2 root root 4096 Sep 17 10:58 bfd-plugins
drwxr-xr-x 2 root root 4096 Sep 17 10:58 ldscripts

/usr/lib/arm-linux-gnueabihf:
total 36
drwxr-xr-x 34 root root 36864 Oct 18 20:01 arm-linux-gnueabihf
qw@qw-desktop:~$
 
Last edited:
I actually wanted to scp the directory first

You can't scp a directory. (well, there are some tricks)
Usually if it's a lot of files (to me more than 3 is a lot)
I usually archive them up with tar or zip, and then transfer them all
at the same time (directory structure included).
 
Status
Not open for further replies.

Members online


Top