tar

tar creates, lists, tests and extracts uncompressed TAR archives entirely in PHP, with path checks that reject traversal, links and unsafe archive entries.

ArchivesVersion 1.1.5Stable
lil-terminal

Overview

Use TAR when you need one portable file tree without compression — for example a deployment bundle, backup or hand-off. -l inspects the contents, -t validates the archive, and -f is required before existing output is replaced.

TAR is a container, not compression

A TAR archive stores a directory tree as one file but does not compress its payload. -d delegates source removal to del only after archive creation succeeds, so creating and deleting remain two distinct operations.

Syntax

lil-terminal
tar <src|arc.tar> [dst] [options]

Reference

tar <src> [dst]

create an uncompressed TAR archive

tar <arc.tar> [dst]

extract into the current directory or <dst>

One package, no compression

tar joins files and folders into one .tar without compressing their bytes. It is useful when you need a simple deployment bundle or to move a directory tree. For smaller downloads, use zip with compression.

Inspect before unpacking

tar tmp/data.tar -l lists entries; -t checks headers, paths and file data without writing any files. Extract with tar tmp/data.tar tmp/restored. A missing destination folder can be created.

Overwriting and removing the source

-f explicitly allows replacing a TAR file or files at the extraction destination; without it conflicts stop the command. -d asks the separate del module to remove the source only after successful creation. Use it only when you no longer need the original.

Safety limits

Archive entries with absolute paths, .. traversal, symbolic links or unsupported types are refused during extraction. The command needs PHP PharData.

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.

Create an uncompressed TAR archive

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 tar
Minimum package

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

install tar -m
Exact public version

Install exactly this published version.

install tar -v 1.1.5
Check or update

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

upgrade tar
Remove module

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

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

Create an uncompressed TAR archive
cd \sandbox | tar data tmp/data.tar
sandbox

README.txt
current.txt
data.tar
data.zip
draft.txt
new.txt
Tar · list
tar tmp/data.tar -l
D  -      data/
F  59 B   data/sample.csv
F  100 B  data/sample.txt
F  102 B  data/users.json
Tar · test
tar tmp/data.tar -t
Status   Archive OK
Entries  4
Files    3
Size     261 B
Extract into the current directory or <dst>
tar tmp/data.tar tmp/restored
restored/
  data/
    sample.csv
    sample.txt
    users.json
Create an uncompressed TAR archive
tar data tmp/data.tar
Archive already exists
Tar · data
tar data tmp/data.tar -f
README.txt
current.txt
data.tar
data.zip
draft.txt
new.txt
Tar · txt
tar tmp/draft.txt tmp/draft.tar -d
README.txt
current.txt
data.tar
data.zip
draft.tar
new.txt
(source draft.txt removed only after successful creation)
Tar · tar
tar tmp/data.tar -l -t
?
Create an uncompressed TAR archive
tar missing tmp/missing.tar
Source not found

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.1.52026-10-31

Preserve existing TAR files during replacement

Archive replacement preserves the previous TAR file until the new one is ready.