Skip to main content
added 136 characters in body
Source Link
alexis
  • 5.9k
  • 3
  • 24
  • 28

TheIf you're running this scp command you are tryingon the remote machine, it is looking for file.ext on your local machineas a "local" file, i.e. on the remote machine.

To copy a file from the remote machine to the local one, use scp -P 2222 username@domain:dir/file.ext localdir (assuming that file.ext is in ~/dir on the remote computer, as in your example). If you run scp on the remote machine, reverse "local" and "remote".

The command you are trying is looking for file.ext on your local machine. To copy a file from the remote machine to the local one, use scp -P 2222 username@domain:dir/file.ext localdir (assuming that file.ext is in ~/dir on the remote computer, as in your example).

If you're running this scp command on the remote machine, it is looking for file.ext as a "local" file, i.e. on the remote machine.

To copy a file from the remote machine to the local one, use scp -P 2222 username@domain:dir/file.ext localdir (assuming that file.ext is in ~/dir on the remote computer, as in your example). If you run scp on the remote machine, reverse "local" and "remote".

Source Link
alexis
  • 5.9k
  • 3
  • 24
  • 28

The command you are trying is looking for file.ext on your local machine. To copy a file from the remote machine to the local one, use scp -P 2222 username@domain:dir/file.ext localdir (assuming that file.ext is in ~/dir on the remote computer, as in your example).