# unikraft instances copy

Copy a single file to or from an instance which has the sandbox
plugin loaded.

A path on an instance is written as `<instance>:<path>`, optionally
prefixed with a metro as `<metro>/<instance>:<path>`. Exactly one of
the two paths may name an instance.

Copying to an instance always overwrites the remote file. Copying
from one writes a regular local file, without the permissions it
had on the instance.


```
unikraft instances copy <source> <destination> [flags]
```

## Examples

Copy a local file to an instance:

```bash
unikraft instance copy ./config.json my-instance:/etc/app.json
```

Copy a file off an instance:

```bash
unikraft instance copy my-instance:/var/log/app.log ./app.log
```

Copy a file into a directory, keeping its name:

```bash
unikraft instance copy my-instance:/var/log/app.log ./logs/
```

Copy a file to an instance in a specific metro:

```bash
unikraft instance copy ./data.bin fra/my-instance:/var/lib/app.bin
```

## Options

```
  --force                     Overwrite the local file if it already exists.
  -p, --parents               Create missing parent directories on the destination path.
  --plugin name               Name of the sandbox plugin to use. (default sandbox)
```

## Options inherited from parent commands

```
  --config file               Path to the configuration file.
  --log-level level           Set the logging level. (default info)
  --log-type type             Set the log type. (default text)
  --profile name              Set the current profile.
  --telemetry                 Toggle usage analytics. (default true)
  --timeout duration          Set a deadline for the command (e.g. 30s, 5m, 1h).
```

## See Also

* [`unikraft instances`](../instances.mdx): Manage Unikraft Cloud instances.

