Sample Header Ad - 728x90

Why did 'scp 10.0.0.11:/home/someuser/.*' start copying from /home as well?

15 votes
1 answer
2712 views
I'm doing my first ever moving of user files from an old system to a new system. My goal is to use SCP for it's simple syntax of scp -r source destination. I tried the following command to copy the files first:
scp -r root@10.0.0.11:/home/someuser/* .
In retrospect, and from past experience, this copied all files without a leading .. In my attempt to fix this, I did this:
scp -r root@10.0.0.11:/home/someuser/.* .
meaning wildcard for anything starting with a .. Obviously (why I'm asking the question) it didn't do what I wanted. The observed result, was that it interpreted the . as moving up a level in the path, and it started copying /home/* instead, also (I think) placing the files one level up from my working directory, rather than the working directory itself. Is my interpretation of the execution of the second command correct? I think it was easy to fix since I was in ~/backup, so one level up was ~. I just rm -rf ~/someuser on each username that had copied before interrupted the command. Those someuser directories were supposed to be in ~/backup I have since learned how to copy the files I wanted by specifying the directory only, not the files contained in the directory.
Asked by Brian (292 rep)
Sep 25, 2022, 03:51 PM
Last activity: Sep 26, 2022, 07:51 PM