If there were no files¹ in the current directory, then
scp successively copied all the remote files to a file called
*. In other words, the file
./* now contains the last remote file in alphabetical order. If any of the remote files were directories,
scp displayed an error message but went on copying.
If there was a single regular file in the current directory, then
scp successively copied all the remote files to that one file.
If there were at least two entries in the current directory, what happened depends on the file type of the last entry in alphabetical order (the last element in the list if you run
- If it was a regular file,
scp aborted with the error “Not a directory”.
- If it was a directory,
scp copied all the remote files and all the files in the current directory except for that last entry into said directory.
I recommend mounting remote directories with sshfs or using
rsync -av or
rsync -auv (without wildcards) to copy files.
scp can be error-prone at times.
¹ Except for files whose name begin with a