Exchange files and folders between local and remote machine with secure copy scp

You’d like to exchange data – files or folders – from a local machine to a remote one or visa verce?
scp (secure copy) is the tool of choice.

Copy local file to remote folder

scp localfile.txt user@123.123.123.123:/remote-target-folder

Copy local folder to remote folder

scp -r localfolder user@123.123.123.123:/remote-target-folder

Copy remote file to local folder

scp user@123.123.123.123:/folder/remotefile.txt /local-target-folder

Copy remote folder to local folder

scp -r user@123.123.123.123:/remote-folder /local-target/folder