> For the complete documentation index, see [llms.txt](https://docs.exavault.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exavault.com/connection-methods/sftp/command-line-sftp-examples.md).

# Command-Line SFTP Examples

Many operating systems include an `sftp` command for connecting to ExaVault and transferring files.

## Connect With a Password

Specify the username and the fully qualified domain name of the ExaVault appliance:

```bash
sftp username@files.example.com
```

Enter the password when prompted.

## Connect With an SSH Key

Save the private SSH key in a location accessible only to the person or process that uses it. For example, save it as `my_ssh_key.key`.

On macOS or Linux:

```bash
sftp -i /path/to/my_ssh_key.key username@files.example.com
```

On Windows:

```powershell
sftp -i C:\path\to\my_ssh_key.key username@files.example.com
```

The `-i` option identifies the private-key file. See [SSH Key Authentication](/connection-methods/sftp/ssh-key-authentication.md) for key creation and installation.

## Upload Files

Upload one file with `put`:

```
put file.ext
```

Upload several named files with `mput`:

```
mput file1.ext file2.ext file3.ext
```

You can also use a wildcard:

```
mput file*.ext
```

### Upload a Folder

Create the destination folder:

```
mkdir TheFolderName
```

Then upload the folder contents recursively:

```
put -r TheFolderName/
```

## Download Files

Download one file with `get`:

```
get file.ext
```

Download several named files with `mget`:

```
mget file1.ext file2.ext file3.ext
```

You can also use a wildcard:

```
mget file*.ext
```

### Download a Folder

Create the local destination folder:

```
lmkdir TheFolderName
```

Set the local permission mask when the downloaded files should be writable by the owner and group:

```
lumask 002
```

Then download the folder contents recursively:

```
get -r TheFolderName/
```

Choose a different `lumask` when your local security policy requires more restrictive permissions.
