scp.md 1.85 KB
Newer Older
1
2
3
+++
title = "File Transfer with scp"
description = "Transfering data to and from HCC clusters with the scp command"
4
weight = "10"
5
6
7
8
+++

## Using the SCP command

Caughlin Bohn's avatar
Caughlin Bohn committed
9
For MacOS, Linux, and Windows 10 users, file transferring between your personal computer
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
and the HCC supercomputers can be achieved through the command `scp` which stands for secure copy.
This method is ideal for quick transfer of smaller files. For large volume transfers,
we recommend the using [Globus] or an SCP client such as [WinSCP for Windows]({{< relref "winscp">}}) or 
[CyberDuck for Mac/Linux]({{< relref "cyberduck">}}).

Just like the `cp` copy command, the `scp` command requires two arguments, 
the path to source file(s) and the path to the target location.
Since one or more of these locations are remote, you will need to specify the username and host for those.

{{< highlight bash >}}
$ scp <username>@<host>:<path_to_files> <username>@<host>:<path_to_files>
{{< /highlight >}}

For the local location, you do not need to specify the username or host. **When transferring to and from
your local computer, the `scp` command should be ran on your computer, NOT from HCC clusters.**

### Uploading a file to Crane

Here is an example of file transfer to and from the Crane cluster.

To upload the file `data.csv` in your current directory to your `$WORK` directory 
on the Crane cluster, you would use the command:

{{< highlight bash >}}
$ scp ./data.csv <user_name>@crane.unl.edu:/work/<group_name>/<user_name>
{{< /highlight >}}

where `<user_name>` and `<group_name>` are replaced with your user name and your group name.

### Downloading a file from Crane

To download the file `data.csv` from your `$WORK` directory 
on the Crane cluster to your current directory, you would use the command:

{{< highlight bash >}}
$ scp <user_name>@crane.unl.edu:/work/<group_name>/<user_name>/data.csv ./
{{< /highlight >}}