copy

Copy files and folders without silently overwriting existing data.

FilesVersion 1.2.6Stable
lil-terminal

Overview

copy report.txt backup/report.txt makes a separate file copy. If backup already exists as a folder, copy report.txt backup places the file there under its original name. With one argument, copy ../backup copies the **contents of the current directory** to a destination outside that directory. Name collisions stop the operation by default: use -i to skip, -r to replace or -c to keep both.

Copy with conflicts under control

Check the destination before copying. copy report.txt backup -c keeps both versions with names such as report.copy-001.txt. -r may replace a whole directory and remove older contents. Use -a for TAR or -A for ZIP archives beside the source when the matching module is installed.

Syntax

lil-terminal
copy [options] <dst> · <src> <dst>

Reference

copy <dst>

copy current-directory contents to <dst> outside that directory

copy <src> <dst>

copy a file or directory to <dst> or an existing directory

copy <src> -a

create <src>.tar beside the source @tar

copy <src> -A

create <src>.zip beside the source @zip

-i

skip existing items (instead of failing)

-r

replace existing items

-c

create a unique .copy name on conflict

-f

copy files only while preserving directory paths

-F

copy directories only

-a

create a TAR archive @tar

-A

create a ZIP archive @zip

Destination rules

Check the destination before copying. copy report.txt backup -c keeps both versions with names such as report.copy-001.txt. -r may replace a whole directory and remove older contents. Use -a for TAR or -A for ZIP archives beside the source when the matching module is installed.

Conflict policies

Without a policy flag, an existing destination stops the operation with Destination already exists. -i is useful for idempotent merges, -r explicitly replaces conflicts, and -c preserves both copies by choosing names such as file.copy-001.txt.

Archive shortcuts

copy folder -a creates folder.tar beside folder; copy folder -A creates folder.zip. With a second destination argument the archive is written there. TAR and ZIP remain optional feature dependencies and are never simulated when their module or PHP capability is unavailable.

Safety

A directory cannot be copied into itself. Symbolic links are copied as links when possible and are not followed recursively.

With one destination argument, the current directory contents are copied only to a location outside the source tree. To copy an individual folder, specify source and destination.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Copy a file or directory to <dst> or an existing directory

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install copy
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install copy -m
Exact public version

Install exactly this published version.

install copy -v 1.2.6
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade copy
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install copy -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Copy a file or directory to <dst> or an existing directory
cd \sandbox | copy data/sample.txt tmp/sample.txt | cd tmp
README.txt
current.txt
sample.txt

README.txt
current.txt
sample.txt
Copy current-directory contents to <dst> outside that directory
cd \sandbox\data | copy \sandbox\tmp\data-copy
sample.csv
sample.txt
users.json
Copy a file or directory to <dst> or an existing directory
copy \sandbox\data\sample.txt \sandbox\tmp\sample.txt
Destination already exists: \sandbox\tmp\sample.txt
Skip existing items (instead of failing)
copy \sandbox\data\sample.txt \sandbox\tmp\sample.txt -i
tmp/
README.txt
sample.txt
Create a unique .copy name on conflict
copy \sandbox\data\sample.txt \sandbox\tmp\sample.txt -c
tmp/
README.txt
sample.copy.txt
sample.txt
Replace existing items
copy \sandbox\data\sample.txt \sandbox\tmp\sample.txt -r
tmp/
README.txt
sample.txt
Copy files only while preserving directory paths
copy \sandbox\public \sandbox\tmp\public-files -f
public-files/
assets/
  app.js
  style.css
index.html
Copy directories only
copy \sandbox\public \sandbox\tmp\public-folders -F
public-folders/
assets/
Copy · tar
install tar | copy \sandbox\data -a
Installed tar, v1.9 (base)

sandbox/
data/
data.tar
Copy · zip
install zip | copy \sandbox\data -A
Installed zip, v1.8 (base)

sandbox/
data/
data.zip
Create <src>.tar beside the source @tar
copy \sandbox\data\sample.txt -a
sample.txt.tar

File used in this example: sandbox/data/sample.txt

The example uses a file or directory from the protected /sandbox/ documentation workspace.

lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.

Related documentation

Current public release

v1.2.62026-10-31

Numbered conflict copies

number copies as .copy-001, .copy-002.