Ok, so I already know how to copy a file in my machine to another one, and when I do it, (I'm trying to copy it to a sudo protected directory) it says permission denied. I do not know where to put the sudo so it isn't in my machine but it doesn't get in the way of the directory. Here's what I normally type:
scp /Users/username/Documents/folder/folder/script.py pi@192.168.x.xx:/usr/local/bin
rsync
but I can tell something about the first command: (1)/remote/path/to/file
is quoted locally but not in the remote shell; some paths may be misinterpreted, possibly badly. (2)tee
will unnecessarily print its input, ultimately to the local terminal; in general the input file may be big and/or binary. (3)sudo
may ask for password or require tty anyway; see this question of mine for some insight. My point is the first command will work in fortunate circumstances, but in less fortunate it may wreak havoc. – Kamil Maciorowski Dec 18 '21 at 15:32