Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

copy

Copies a file to a new name in the same directory.

Syntax

# Simple form - just the new filename
- copy: backup.txt

# With template
- copy: "${name}_backup${ext}"

# With conflict handling
- copy:
    new_name: "${name}_backup${ext}"
    on_conflict: overwrite

Options

optiontyperequireddefaultdescription
new_namestringYes-New filename (supports templates)
on_conflictstringNorename_with_suffixHow to handle existing files

Conflict handling

modebehavior
rename_with_suffixAdd numeric suffix (file_2.txt, file_3.txt, etc.). This is the default
skipDon’t copy if destination file exists
overwriteReplace existing destination file

Examples

Simple copy

- copy: backup.txt

Copy with original name preserved

- copy: "${name}_copy${ext}"

Copy with timestamp

- copy: "${name}_%Y%m%d${ext}"

Backup with overwrite

- copy:
    new_name: "${name}_backup${ext}"
    on_conflict: overwrite

Template variables

The new_name field supports template variables:

- copy: "${name}_%H%M${ext}"

See Templates for all available variables.

Notes

  • Copies to the same directory as the source file
  • The new_name must not contain path separators
  • Original file remains unchanged
  • To copy to a different directory, first copy the file and then use the move action