Use tar on Windows to Create and Extract Archives
Windows 10/11 bundle bsdtar, so tar -czf and tar -xzf work natively in cmd and PowerShell — including .zip files.
01Command
$ tar -czf backup.tar.gz -C C:\Proj .
tar -xzf backup.tar.gz -C D:\Restore02What it does
Since Windows 10 1803, bsdtar (the libarchive implementation) ships in System32, closing the gap with Linux/macOS workflows — handy for source trees, Docker context files and anything that expects a tarball. -C changes the source directory so the archive stores relative paths instead of full ones like C:\. The same binary also extracts .zip files (tar -xf file.zip) and auto-detects compression, so plain tar -xf works for both .tar.gz and .tar.bz2.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- TAR - SS64Evidence: Shows tar create/extract examples on Windows and notes it also reads .zip archives.
Last verified: 2026-09-18 · Category: Developer
06Related solutions
Use Windows Package Manager to install, search, and upgrade thousands of applications from the community repository in one command.
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
One command that shows OS version, install date, boot time, memory, network adapters and installed hotfixes.