# TAR
GNU 'tar' saves many files together into a single tape or disk archive, and can
restore individual files from the archive.

## Overview
| Command | Description |
| - | - |
| `tar -czf backup_$(date + %F_%H-%M-%S).tar.gz <dir1> <dir2>` | Create <backup_file> with dir1 and dir2 as content |
| - | - |
| `tar -tzf <file>` | Show directories from proton |
| - | - |
| `tar -xzf <file> -C <dir to restore>` | Extract content from <file> into <dir to restore> |
| `tar -xzf <file> --strip-components=2 -C <dir to restore>` | Extract content from <file> into <dir to restore> but ignores first 2 levels of directory structur |

## Meta Data
:::info
Tar per default saves meta data such as user and group rights
:::
:::warning
To correctly restore user and group rights do tar -xzf with **sudo**
:::
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9