Skip to content

Commit 803dec1

Browse files
authored
Merge pull request #849 from CHTC/preview-transfer-files-local
Update file transfer guide between local pc/CHTC
2 parents 75f1fd3 + e8d5097 commit 803dec1

File tree

1 file changed

+39
-71
lines changed

1 file changed

+39
-71
lines changed

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

+39-71
Original file line numberDiff line numberDiff line change
@@ -9,67 +9,63 @@ guide:
99
- hpc
1010
---
1111

12+
## Introduction
13+
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.
14+
1215
{% capture content %}
13-
1. [Transferring Files](#transfer)
14-
- [On the command line](#transfer-scp)
15-
- [Using an SSH program (Windows/Mac)](#transfer-winscp)
16-
- [Re-using SSH connections](#transfer-many)
17-
3. [Creating and Editing Files in CHTC](#files)
16+
- [Introduction](#introduction)
17+
- [Before you transfer](#before-you-transfer)
18+
- [Option 1: Transfer files with the `scp` command line utility](#option-1-transfer-files-with-the-scp-command-line-utility)
19+
- [Option 2: Transfer files with a file transfer program](#option-2-transfer-files-with-a-file-transfer-program)
20+
- [Transfer multiple files using tarballs](#transfer-multiple-files-using-tarballs)
21+
- [Related pages](#related-pages)
1822
{% endcapture %}
1923
{% include /components/directory.html title="Table of Contents" %}
2024

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

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

3033

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

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

39-
**Your computer to CHTC**
39+
**Upload files from your computer to CHTC**
4040

41-
First, open the \"Terminal\" application and navigate to the directory
42-
with the files or directories you want to transfer. Then, use this
41+
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
4342
command to copy these files to CHTC:
4443

4544
```
46-
$ scp file username@hostname:/home/username
45+
scp file username@hostname:/home/username
4746
```
4847
{:.term}
4948

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

53-
**CHTC to your computer**
52+
**Download files from CHTC to your computer**
5453

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

5958
```
60-
$ scp username@hostname:/home/username/file ./
59+
scp username@hostname:/home/username/file ./
6160
```
6261
{:.term}
6362

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

69-
<a name="transfer-winscp"></a>
7067

71-
B. Using a file transfer program (Windows/Mac)
72-
----------------------------------------------
68+
## Option 2: Transfer files with a file transfer program
7369

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

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

86-
There are other programs besides WinSCP that do this. Another that works
87-
on Mac and Windows is called [Cyberduck](https://cyberduck.io).
82+
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.
8883

89-
<a name="transfer-many"></a>
9084

91-
C. Transferring Multiple Files
92-
------------------------------
85+
## Transfer multiple files using tarballs
9386

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

9990
```
100-
$ tar czf data_files.tar.gz file_directory/
91+
tar czf data_files.tar.gz file_directory/
10192
```
10293
{:.term}
10394

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

112-
or
97+
To untar files, use the tar command again:
11398

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

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

0 commit comments

Comments
 (0)