Manage, Create and Extract files by using tar command
Create, append, update, or delete files in an archive.
Extract, list, or modify files during extraction.
Choose the compression algorithm for the archive.
Specify archive file, exclude files, or include patterns.
Retain ownership, preserve access time, or dereference links.
Display progress or verbose output during operations.
Verify archives, display numeric IDs, or ignore failed reads.
Create incremental backups, stay on one filesystem, or set blocking factors.
tar
Command | Description |
---|---|
tar -cvf archive.tar test1.txt test2.txt | Creates a Tar Archive (-v verbose shows progress) |
tar -xvf archive.tar | THis Command Extracts a Tar Archive |
tar -czvf archive.tar.gz test1.txt test2.txt | Create a Compressed Tar Archive |
tar -xzvf archive.tar.gz | Extracts a Compressed Tar Archive (Gzip) |
tar -xvf archive.tar -C /dest/path | Extract Files to a Specific Directory |
tar -tvf archive.tar | List Contents of a Tar Archive Without Extracting |
tar -rvf archive.tar newfile.txt | Add a File to an Existing Archive |
tar --delete -f archive.tar test1.txt | Remove a File from an Archive |