# move-path

Learn how to move or rename files and directories.

This action moves or renames a file or directory.

For example, you can rename `.env.example` to `.env` after scaffolding a project, relocate downloaded files to their final paths, or restructure directories during setup.

## Example

The following template renames an example environment file:

**template.json5**

```json5
{
  "$schema": "https://schema.croct.com/json/v1/template.json",
  "title": "Env setup",
  "description": "Renames the example environment file.",
  "actions": [
    {
      "name": "move-path",
      "path": ".env.example",
      "destination": ".env"
    }
  ]
}
```

To apply this template, run:

```sh
croct use template.json5
```

The source file is renamed to `.env`. If the destination already exists, the action fails unless [`overwrite`](#overwrite-prop) is enabled.

## Properties

These are the supported properties:

- `name`: `string`

  The action identifier. Always `move-path` for this action.

- `path`: `string`

  The source path to move.

- `destination`: `string`

  The destination path.

- `overwrite`: `boolean` (optional) (default: false)

  Whether to overwrite the destination if it already exists.

## Explore

- [Delete path](/reference/cli/templates/actions/delete-path): Learn how to delete a file or directory.
- [Create directory](/reference/cli/templates/actions/create-directory): Learn how to create the destination directory.
- [Locate path](/reference/cli/templates/actions/locate-path): Learn how to find the path to move.
- [Write file](/reference/cli/templates/actions/write-file): Learn how to write content to a file.
