copy

Copy files and directory trees with explicit conflict policies, filters and direct TAR/ZIP shortcuts.

FilesVersion 1.2.4Stable
lil-terminal

Overview

copy keeps conflicts explicit: a normal copy never overwrites silently, while -i, -r and -c provide three deliberate policies. With -a or -A the same source can be packaged as TAR or ZIP beside it.

Copy with conflicts under control

Treat conflicts as a decision, not an accident: inspect the destination first and choose skip, replace or unique-copy behavior explicitly.

Syntax

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

Reference

copy <dst>

copy the contents of the current directory into <dst>

copy <src> <dst>

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

copy <src> -a @tar

create <src>.tar beside the source

copy <src> -A @zip

create <src>.zip beside the source

-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 @tar

create a TAR archive

-A @zip

create a ZIP archive

Destination rules

When <dst> is an existing directory, copy places the source inside it using the original basename. An explicit file path copies to exactly that path. The one-argument non-archive form copies the contents of the current directory into <dst>.

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.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.

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.4
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
pwd | cd \sandbox | copy data/sample.txt workspace/sample.txt | cd workspace | pwd
/home/account/public_html

workspace/
original.txt
replace.txt
sample.txt
updated.txt

/home/account/public_html/sandbox/workspace
Copy the contents of the current directory into <dst>
cd \sandbox\data | copy \sandbox\tmp\data-copy
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/
Create <src>.tar beside the source
install tar | copy \sandbox\data -a
Installed tar, v1.9 (base)

sandbox/
data/
data.tar
Create <src>.zip beside the source
install zip | copy \sandbox\data -A
Installed zip, v1.8 (base)

sandbox/
data/
data.zip

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.42026-08-12

Language synchronization

Finalizes Local and Server Help synchronization and localization safety for copy.