tar
Tape ARchive. Used to collect many files into one archive file, often compressed significantly.
Synopsis
tar [options] [archive-file] [file or directory to be archived]
Core Options
-cCreate a new archive.
-xExtract files from an archive.
-zFilter the archive through gzip (for .tar.gz).
-vVerbose. List files processed.
-f fileUse archive file or device ARCHIVE.
-tList the contents of an archive.
Usage Examples
Create Compressed Archive
Create a gzip-compressed tarball of the 'project' directory.
tar -czvf project.tar.gz project/Extract Archive
Extract a .tar.gz file to the current directory.
tar -xzvf archive.tar.gzList Contents
List files inside the archive without extracting them.
tar -tf archive.tar.gzExtract to Specific Directory
Extract files to the /tmp folder.
tar -xzvf archive.tar.gz -C /tmpCreate Archive Excluding Files
Create archive but exclude 'node_modules'.
tar --exclude='node_modules' -czvf project.tar.gz project/Built for builders.