The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
scp tricks 7 March 2003
Need more help on this topic? Click here
This article has 23 comments
Show me similar articles

If you don't know about scp, then today is your lucky day. It is a great tool for copying file around. In the following examples, here are the terms I will use:

  • remotebox is the IP address or hostname of the remote box.
Here are a few pratical examples to help you get started:
  • copy a file to a remote system:

    scp a remotebox:

  • copy a file to a remote system, and put it somewhere other than your home directory:

    scp a remotebox:/var/tmp

    That will copy a from your current working directory to /var/tmp on the remote box.

  • copy a file to a remote system but a different user id:

    scp a mark@remotebox:

  • copy file from a remote system:

    scp remotebox:a .

  • copy file from a remote system, different login:

    scp mark@remotebox:a .

  • copy recursively from a remote system, different login:

    scp -r mark@remotebox:a .

  • copy a number of files from a remote system to a specified directory locally:

    scp remotebox:\{a,b,c\} ~/my/secret/dir

If you have more good ideas about scp, please put them in the article comments. Thank you.

Need more help on this topic? Click here
This article has 23 comments
Show me similar articles