Windows tar.exe -cf equivalent in Linux
Combines files and directories into a TAR archive without necessarily compressing them.
tar.exe -cf
tar -cf archive.tar folder/
tar -cf archive.tar folder/
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.
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.
For the broader concept behind this mapping, read Linux filesystem for Windows users.
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 option | Use |
|---|---|
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.
| Distribution | Package manager / base | Equivalent command | Difference 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