Skip to content

Instantly share code, notes, and snippets.

@cecyc
Last active May 15, 2017 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecyc/5febbc164c6edba6057b5ae67d35a815 to your computer and use it in GitHub Desktop.
Save cecyc/5febbc164c6edba6057b5ae67d35a815 to your computer and use it in GitHub Desktop.
Copying remote files via CLI

How to copy a file in a remote onto your local machine:

scp REMOTE:FILENAME ./

REMOTE: where the file is FILENAME: the file you want to copy ./ where the file will be copied to (do not have to name it as it will use the name of the file in the remote

You can run a SQL query and pipe into a file on a remote location, then use method above to copy locally.

mysql u:p host -e"sql command;" > output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment