← All commands
Topic hub File Management
Windows Linux File Management Expanded guide Archives & Compression

Windows tar.exe -cf equivalent in Linux

Combines files and directories into a TAR archive without necessarily compressing them.

Windows tar.exe -cf
→
Linux equivalents
Debian/Ubuntu same command
tar -cf archive.tar folder/
Fedora same command
tar -cf archive.tar folder/
Arch same command
tar -cf archive.tar folder/

Overview

What this command does

On Windows, "tar.exe -cf" is used to create a TAR archive. On Linux, the closest practical mapping shown here is "tar -cf archive.tar folder/". Combines files and directories into a TAR archive without necessarily compressing them. This reference is grouped under File Management → Archives & Compression.

Migration tip: <code>tar</code> is available on modern Windows and Linux, but Linux users commonly combine it with gzip or xz using <code>-z</code> or <code>-J</code>.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows tar.exe -cf maps to tar -cf archive.tar folder/ for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Practical tasks

Common use cases

Create a TAR archive

Combines files and directories into a TAR archive without necessarily compressing them.

tar -cf archive.tar folder/

Create an uncompressed TAR archive

tar -czf archive.tar.gz folder/

Create a gzip-compressed TAR archive

tar -cJf archive.tar.xz folder/

Create an xz-compressed TAR archive

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

tar -cf archive.tar folder/
tar -czf archive.tar.gz folder/
tar -cJf archive.tar.xz folder/

Walkthrough

Examples with explanations

tar -cf archive.tar folder/ # create a plain TAR archive
tar -czf archive.tar.gz folder/ # create a compressed tar.gz archive
tar -cJf archive.tar.xz folder/ # create a highly compressed tar.xz archive

Reference

Common options and variations

Command or optionUse
tar -cf archive.tar folder/Create an uncompressed TAR archive
tar -czf archive.tar.gz folder/Create a gzip-compressed TAR archive
tar -cJf archive.tar.xz folder/Create an xz-compressed TAR archive

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "tar -cf archive.tar folder/" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command tar -cf archive.tar folder/ Same command on this distribution.
Fedora same command tar -cf archive.tar folder/ Same command on this distribution.
Arch same command tar -cf archive.tar folder/ Same command on this distribution.

Keep learning

Related File Management commands