0

I want to copy the entire root file system from a target to a specific folder in the host. When I try this, I just get a README.txt file in the desired location. When I open the file, it says "Download and extract the sample filesystem to this directory."

Does anyone know the problem? Below is the input and output of the terminal.

rish@myComp:~$ scp -r comp@<IP Address>:/*.* /desired/location

comp@<IP Address>'s password: 

README.txt                                    100%   62   107.0KB/s   00:00    
0

In Windows *.* matches all, even if no dot is there. In Linux (and in scp) *.* glob pattern matches objects with literal dot.

There is no dot in bin, home etc. Apparently the only object with a dot was README.txt.

Use * instead of *.* (or not, see below).

Notes:

  • Unquoted * may be expanded by your local shell. I don't expect comp@<IP Address>:/* to match any file in your current working directory, but still this is somewhat flawed.
  • * doesn't match hidden (dot) files. This is true in a shell and in scp, I think.
  • I wouldn't want to copy /proc, /dev, /tmp. For this reason I would get a listing and request other directories/files explicitly.
  • scp doesn't preserve ownership.
  • Do you know the syntax to specify the folders to copy over excluding /proc, /dev, and /tmp? – Rish Jun 12 at 13:48
  • @Rish No, in scp there is probably none. By "request other directories explicitly" I meant you need to type their names by hand and get them one by one. – Kamil Maciorowski Jun 12 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.