I was confused, trying to copy some files from one PC to another. I have it figured out, but the syntax is still confusing to me. This works:
scp ~/Desktop/Volenteer.png [email protected]:~j0h/b
which puts Volenteer.png
in the folder /home/j0h/b
. However, this doesn't work:
scp ~Desktop/Volenteer.png [email protected]:~j0h/b
This also fails, giving an exit status 1 file not found:
scp ~/Desktop/Volenteer.png [email protected]:~/j0h/b
As does this:
scp ~Desktop/Volenteer.png [email protected]:~j0h/b
So clearly, there is some difference between ~
and ~/
That difference is the presence of /
$~/
bash: /home/j0h/: Is a directory
$ ~
bash: /home/j0h: Is a directory
So why in scp, does the ~
resolve to ~/
?
That is a guess, I cant verify that's what is happening.
But it seems inconsistent, and therefore confusing.
Is this a bug in scp? or is there something about tilde I am missing?