Skip to content

Commit e8d5097

Browse files
committed
Update file transfer guide between local pc/CHTC
1 parent 8489226 commit e8d5097

File tree

1 file changed

+39
-71
lines changed

1 file changed

+39
-71
lines changed

_uw-research-computing/transfer-files-computer.md

Lines changed: 39 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -10,67 +10,63 @@ guide:
1010
- hpc
1111
---
1212

13+
## Introduction
14+
This guide shows how to transfer (upload/download) files between a local computer and CHTC's file systems. Two options are presented: the `scp` command line utility, and a file transfer program. Additionally, we present tarballs as a way to transfer multiple files easily.
15+
1316
{% capture content %}
14-
1. [Transferring Files](#transfer)
15-
- [On the command line](#transfer-scp)
16-
- [Using an SSH program (Windows/Mac)](#transfer-winscp)
17-
- [Re-using SSH connections](#transfer-many)
18-
3. [Creating and Editing Files in CHTC](#files)
17+
- [Introduction](#introduction)
18+
- [Before you transfer](#before-you-transfer)
19+
- [Option 1: Transfer files with the `scp` command line utility](#option-1-transfer-files-with-the-scp-command-line-utility)
20+
- [Option 2: Transfer files with a file transfer program](#option-2-transfer-files-with-a-file-transfer-program)
21+
- [Transfer multiple files using tarballs](#transfer-multiple-files-using-tarballs)
22+
- [Related pages](#related-pages)
1923
{% endcapture %}
2024
{% include /components/directory.html title="Table of Contents" %}
2125

22-
<a name="transfer"></a>
23-
24-
**1. Transferring Files**
25-
=====================
26+
## Before you transfer
2627

27-
To transfer files to and from CHTC, you will need the same username and
28-
hostname information for [logging in](#login), as well as understanding
29-
where your files are and where you would like them to go.
28+
To transfer files to and from CHTC, you will need:
29+
* Your username and hostname information for [logging in](connecting)
30+
* The location on the file system of the files to be transferred (also referred to as the "path")
31+
* The location on the file system where you'd like to transfer your files to.
32+
* Basic skills in [navigating file systems](basic-shell-commands#navigate-directories)
3033

3134

32-
<a name="transfer-scp"></a>
33-
34-
A. On the command line
35-
----------------------------------
35+
## Option 1: Transfer files with the `scp` command line utility
3636

3737
On Mac, Linux, or modern Windows (10+) systems, you can use the \"Terminal\" application and
3838
the `scp` command to copy files between your computer and CHTC servers.
3939

40-
**Your computer to CHTC**
40+
**Upload files from your computer to CHTC**
4141

42-
First, open the \"Terminal\" application and navigate to the directory
43-
with the files or directories you want to transfer. Then, use this
42+
First, open the \"Terminal\" application and navigate to the directory with the files or directories you want to transfer using the [`cd` command](basic-shell-commands#navigate-directories). Then, use this
4443
command to copy these files to CHTC:
4544

4645
```
47-
$ scp file username@hostname:/home/username
46+
scp file username@hostname:/home/username
4847
```
4948
{:.term}
5049

5150
If you would like these files to end up in a different directory inside
5251
your home directory, just add it to the path at the end of the command.
5352

54-
**CHTC to your computer**
53+
**Download files from CHTC to your computer**
5554

5655
Open the \"Terminal\" application. Do NOT log into CHTC. Instead,
5756
navigate to where you want the files to go on your computer. Then, use
5857
this command to copy these files there:
5958

6059
```
61-
$ scp username@hostname:/home/username/file ./
60+
scp username@hostname:/home/username/file ./
6261
```
6362
{:.term}
6463

65-
Again, for many files, it will be easiest to create a compressed tarball
64+
For transferring many files, it will be easiest to create a compressed tarball
6665
(.tar.gz file) of your files and transfer that instead of each file
67-
individually.
68-
66+
individually.
6967

70-
<a name="transfer-winscp"></a>
7168

72-
B. Using a file transfer program (Windows/Mac)
73-
----------------------------------------------
69+
## Option 2: Transfer files with a file transfer program
7470

7571
Windows and Mac users can also use special programs to help them
7672
transfer files between their computers and CHTC. For Windows, we
@@ -81,60 +77,32 @@ looks like this:
8177
![](/images/WinSCPPortable.png)
8278

8379
The left window is a directory on your computer, the right window is
84-
your home directory in CHTC. To move files between the two, simply drag
85-
and drop.
80+
your home directory in CHTC. To move files between the two, simply use your mouse to drag
81+
and drop the files.
8682

87-
There are other programs besides WinSCP that do this. Another that works
88-
on Mac and Windows is called [Cyberduck](https://cyberduck.io).
83+
Another popular file transfer utility available for Mac and Windows is [Cyberduck](https://cyberduck.io). See our [SSH programs](connecting#ssh-programs) table for a list of similar software.
8984

90-
<a name="transfer-many"></a>
9185

92-
C. Transferring Multiple Files
93-
------------------------------
86+
## Transfer multiple files using tarballs
9487

95-
If you are transferring many files, it is advantageous to compress them
96-
into a single compressed file, in order to facilitate transferring them.
97-
Place all the files you need in a directory, and then either zip it or
98-
use the \"tar\" command to compress them:
88+
If you are transferring many files, we recommend compressing them
89+
into a single file. Move all the files you need into a separate directory, and use the \"tar\" command to compress them:
9990

10091
```
101-
$ tar czf data_files.tar.gz file_directory/
92+
tar czf data_files.tar.gz file_directory/
10293
```
10394
{:.term}
10495

105-
To untar or unzip files on the submit server or head nodes, you can use
106-
either:
107-
108-
```
109-
[alice@submit]$ tar xzf data_files.tar.gz
110-
```
111-
{:.term}
96+
Afterwards, you may transfer the single tarball file as usual.
11297

113-
or
98+
To untar files, use the tar command again:
11499

115-
```
116-
[alice@submit]$ unzip data_files.zip
100+
```
101+
tar xzf data_files.tar.gz
117102
```
118103
{:.term}
119104

120-
<a name="files"></a>
121-
122-
**2. Creating and Editing Files in CHTC**
123-
=====================================
124-
125-
Once you have logged in to a CHTC server, you can edit files from the
126-
command line, by using a command line file editor. Some common editing
127-
programs are:
128-
129-
- nano
130-
- vi
131-
- emacs
132-
133-
`nano` is the most beginner-friendly, and `emacs` is the most advanced.
134-
[This Software Carpentry
135-
lesson](https://swcarpentry.github.io/shell-novice/03-create.html) describes
136-
how to use `nano`, and there are many other resources online with
137-
instructions for these text editors.
138-
139-
Some of the file transfer programs mentioned [above](#transfer-winscp)
140-
allow you to edit files on CHTC servers through the interface.
105+
## Related pages
106+
* [Log in to CHTC](connecting)
107+
* [Basic shell commands](basic-shell-commands)
108+
* [Transfer files between CHTC and ResearchDrive](transfer-data-researchdrive)

0 commit comments

Comments
 (0)