SCP - Copying files from the server and vice versa

These following command-line commands are in the context of you being on your local server connecting to your remote server to get files.

From the directory you’re currently in /users/cazepeda/sites/czepeda/.

Copy a file from the remote server into that local directory:

scp username@czepeda.com:/path/to/file.extension /users/cazepeda/sites/

You’ll be prompted to enter your password. After you enter the password you’ll see the file transfer from the remote server to the local directory you specified.

Send a file from your local server directory to the remote server directory:

scp /users/cazepeda/sites/file.extension username@czepeda.com:/path/to/remote/directory/

Again you’ll be prompted to enter your password. After that you’ll see the file transfer from your local directory to your remote server directory.

Pretty simple. But remember that these commands won’t work if you’ll logged into your remote server and are trying to push files down to your local server directory. I accidentally found myself initially doing that. Doh! You live and learn right!?