Ugghh... always forget, maybe I have memory coruption in my brain.
1) To copy a file from hostB to hostA, while logged in to hostB:
[user@server ~]$ scp -P port filename username@hostA.com:.
(copies file to user's home dir on hostA machine, because of the period after the colon)
2) To copy a folder from hostB to hostA, while logged in to hostB first cd to the directory on HostB which contains the folder you want to copy:
[user@server ~]$ scp -r -P port folder username@hostA.com:.(creates new folder if the folder does not exist, again in user's home directory)
3) To copy a file from hostA to hostB, while logged in to hostB:
[user@server ~]$ scp -P port username@hostA.com:filename .
(copies into current directory on hostB)
[user@server ~]$ scp -r -P port username@hostA.com:folder .
(copies whole folder into current directory on hostB)
4) To copy a file or folder within a folder from hostA to hostB, while logged in to hostB:
[user@server ~]$ scp -P port username@hostA.com:/folder/dir/filename .
(copies into current directory on hostB)
[user@server ~]$ scp -r -P port username@hostA.com:/folder/dir .
(copies whole folder into current directory on hostB)
5) Instead of using the '.' to designate files to be copied to a home directory or the current working directory you can give scp an actual path (assuming you have write permissions):
[user@server ~]$ scp -r -P port folder username@hostA:/home/httpd/
[user@server ~]$ scp -P port username@hostA.com:/folder/dir/filename /home/tmp/