Tar Command Builder
Assemble a valid tar command — create, extract, list or append — with every flag explained.
Command options
Suggested extension: .tar.gzGenerated command
3 flagstar czf archive.tar.gz dist/
| Flag | Meaning |
|---|---|
| -c | create (c = C) |
| -z | gzip compression |
| -f | the next argument is the archive filename (f must be last in the flag cluster) |
Tar Command Builder assembles a valid GNU tar invocation from an operation, compression format, archive name, source paths, exclude patterns and options. The compressed flag cluster ends with f immediately before the archive filename, so the command cannot be misordered. Each flag is explained next to the command, and incompatible combinations such as appending to a compressed archive, absolute source paths or zstd on BSD tar are called out as warnings.
tar czvf release.tar.gz --exclude='*.map' dist/ README.md
Create a gzip archive with verbose output and an exclude pattern; c is create, z is gzip, v is verbose and f precedes the filename.
tar xzf release.tar.gz -C out
The -C option changes directory before extraction; the target directory must already exist.
tar tzf release.tar.gz
t lists archive members; keep the compression flag so tar can read the stream.
Examples
czf
create + gzip + release.tar.gz + dist/tar czf release.tar.gz dist/c creates, z compresses with gzip and f introduces the archive name.
xzf with -C
extract + gzip + -C outtar xzf release.tar.gz -C outx extracts and -C requires an existing destination directory.
Compressed append
append + gzipwarning: cannot append to a compressed archiveGNU tar cannot append to gzip streams; create a new archive or drop compression.
About this tool
Tar Command Builder turns a small form into a correct tar command. Choose create, extract, list, append or update; pick none, gzip, bzip2, xz or zstd compression; then add the archive name, source paths and any exclude patterns.
The builder places the f flag last in the short cluster so the archive filename always follows it, and it explains every emitted flag in a companion table. Warnings call out the classic traps: appending to a compressed archive, absolute source paths, zstd on BSD tar and -C during archive creation.
Presets for a release tarball, extraction into a directory, an excluded backup and a compressed-append mistake make the common cases discoverable. Commands are generated locally; nothing about your paths is uploaded.
What this tool does not do
- Commands target GNU tar conventions; some long flags differ on BSD/macOS tar.
- The builder does not execute commands or validate that archive names exist on disk.
- Shell quoting follows POSIX single-quote rules and is not tailored to PowerShell or cmd.exe.
- Zstd support depends on the local tar build; a warning is shown but capability is not probed.
- No options or paths are uploaded or persisted between visits.
How to use this tool
Choose an operation
Create (c), extract (x), list (t), append (r) or update (u) sets the first flag.
Pick compression
None, gzip (-z), bzip2 (-j), xz (-J) or zstd (--zstd); the suggested archive extension updates with your choice.
Add paths and excludes
Enter one source path and one exclude pattern per line. Paths with spaces are shell-quoted automatically.
Set options
Verbose, keep-old-files and preserve-permissions add -v, -k and -p; -C changes directory before the operation.
Copy the command
The generated command and its flag explanations update on every change; copy or download when it looks right.
Use cases
Release packaging
Build a reproducible tarball command with excludes and verbose output.
Restore drills
Generate an extraction command with the right decompression flag and target directory.
Cheat-sheet replacement
Learn what each flag does while assembling a real command instead of scanning a table.
CI scripts
Copy the exact command into a pipeline step and share the flag explanation with reviewers.
Flag clusters
| Cluster | Meaning |
|---|---|
| c / x / t / r / u | Create, extract, list, append or update an archive |
| z / j / J / --zstd | gzip, bzip2, xz or zstd compression |
| v / k / p | Verbose, keep old files, preserve permissions |
| f | Always last in the cluster; the next argument is the archive filename |
| -C dir | Change to dir before processing the remaining paths |
| --exclude=PATTERN | Skip matching paths; place before source paths |
The builder always emits -f last so czf and xzf read naturally and behave predictably.
Common mistakes
Mistake:Putting f before other flags or far from the archive name.
Fix:The builder keeps f last in the cluster and places the filename immediately after it.
Mistake:Appending or updating a .tar.gz in place.
Fix:Remove compression or create a fresh archive; the tool warns on this combination.
Mistake:Using zstd flags with BSD tar on macOS.
Fix:The zstd preset warns that GNU tar 1.31+ is required.
Mistake:Quoting paths with spaces by hand and getting shell escaping wrong.
Fix:The builder applies shell quoting, including embedded single quotes, for you.
Mistake:Assuming -C creates the destination directory.
Fix:Create the directory first; the builder notes this on extraction commands.
Frequently asked questions
What does czf mean in tar?
It is a cluster of three short flags: c creates a new archive, z compresses it with gzip, and f says the next argument is the archive filename. Because f takes an argument, it is always placed last in the cluster.
Why must f come right before the filename?
tar reads the token immediately following the f flag as the archive name. Putting other options in between makes tar treat an option as the filename. The builder enforces f-last ordering structurally, so the generated command stays correct.
What is the difference between z, j, J and --zstd?
z selects gzip (.tar.gz), j selects bzip2 (.tar.bz2), J selects xz (.tar.xz), and --zstd selects zstd (.tar.zst). The right decompression flag must be used on listing and extraction too; the auto-suggested extension changes with your choice.
How do I extract to a specific directory?
Choose Extract, set Compression to match the archive, and fill the Change directory field, for example `tar xzf release.tar.gz -C out`. The destination directory must already exist.
Can tar exclude files?
Yes. Add one glob per line in the Exclude patterns field; the builder emits --exclude=PATTERN before the source paths. Patterns are shell-quoted when they contain special characters.
Can I append to a compressed archive?
No. GNU tar cannot append to gzip, bzip2, xz or zstd streams. The compressed append example demonstrates the warning; create a new archive or use an uncompressed .tar if you need incremental updates.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.