# Single command

For one action, CrushClient takes everything on one line, with no script. The general [command line](Command-Line.md) is on its own page.

```
java -jar CrushTunnel.jar COMMAND [-o option=value] [-c option=value] [-lc option=value] [-v] SOURCE_URL DESTINATION_URL
```

| Command | Does |
|---|---|
| `copy` | copies a file or folder |
| `move` | copies, then deletes the source |
| `delete` | deletes a file or folder (one URL) |
| `rename` | renames (the URL, then the new name) |
| `test` | tests the connection |

| Switch | For |
|---|---|
| `-o name=value` | an option of the client as a whole |
| `-c name=value` | an option of the destination's connection |
| `-lc name=value` | an option of the source's connection (rarely needed) |
| `-v` | more output |

Write each option without spaces: `-o max_threads=10`, not `-o max_threads = 10`. A space breaks the line.

An upload has the local path first; a download has the server first. To be asked for the password instead of writing it on the line, use `-ASK-` as the password.

If the command fails, the exit code is not 0.

## Examples

```
java -jar CrushTunnel.jar copy file://folder1/file.txt https://user:pass@server.com/
java -jar CrushTunnel.jar copy file://folder1/file.txt https://user:pass@server.com/file_new_name.txt
java -jar CrushTunnel.jar copy /C:/folder1/file.txt https://user:pass@server.com/file_new_name.txt
java -jar CrushTunnel.jar copy https://user:pass@server.com/file.txt file://folder1/file.txt
java -jar CrushTunnel.jar copy https://user:-ASK-@server.com/file.txt file://folder1/file.txt
java -jar CrushTunnel.jar copy -o max_threads=10 -c ssh_private_key=/C:/keys/test.ppk sftp://user:pass@server.com:22/file.txt file://folder1/file.txt
java -jar CrushTunnel.jar copy file://folder1/ https://user:pass@server.com/
java -jar CrushTunnel.jar move file://folder1/ https://user:pass@server.com/
java -jar CrushTunnel.jar delete https://user:pass@server.com/folder1/file.txt
java -jar CrushTunnel.jar delete https://user:pass@server.com/folder1/
java -jar CrushTunnel.jar rename https://user:pass@server.com/folder1/file.txt file2.txt
```

## Useful options

| Option | Default | Meaning |
|---|---|---|
| `-c ssh_private_key=/C:/keys/test.ppk` | | the SSH private key for SFTP |
| `-c ssh_private_key_pass=password` | | its password |
| `-o segmented_transfer=false` | true | turns off the faster HTTP(S) transfers to CrushMFT servers |
| `-o max_threads=10` | 10 | files at once when a folder with many items is transferred |
| `-o keep_date=false` | true | do not keep modified dates |
| `-o skip_modified_and_size=false` | true | transfer even when size and date match |
| `-o skip_modified=true` | false | skip on the date alone |
| `-o skip_size=true` | false | skip on the size alone |
