Howto tar » Historie » Version 1
Jeremias Keihsler, 01.10.2024 19:39
| 1 | 1 | Jeremias Keihsler | h1. tar |
|---|---|---|---|
| 2 | |||
| 3 | *tar* is installed by default |
||
| 4 | |||
| 5 | h2. basic tar usage |
||
| 6 | |||
| 7 | the most *nix-style way of getting help for @tar@ is @man tar@ |
||
| 8 | |||
| 9 | for doing some basic storing/unpacking the following sequences should be enough. |
||
| 10 | |||
| 11 | to tar (with gzip) |
||
| 12 | <pre><code class="bash"> |
||
| 13 | tar -cvzf tarfilename foldername |
||
| 14 | </code></pre> |
||
| 15 | |||
| 16 | to tar (with parallel gzip) |
||
| 17 | <pre><code class="bash"> |
||
| 18 | tar --use-compress-program="pigz" -cvf tarfilename foldername |
||
| 19 | </code></pre> |
||
| 20 | |||
| 21 | to untar |
||
| 22 | <pre><code class="bash"> |
||
| 23 | tar -xvzf tarfilename |
||
| 24 | </code></pre> |
||
| 25 | |||
| 26 | the example will tar the folder @abc@ to the archive @abc.tar.gz@: |
||
| 27 | <pre><code class="bash"> |
||
| 28 | tar -cvzf abc.tar.gz abc |
||
| 29 | </code></pre> |
||
| 30 | |||
| 31 | for doing the same while preserving permissions |
||
| 32 | |||
| 33 | to tar |
||
| 34 | <pre><code class="bash"> |
||
| 35 | tar -pcvzf tarfilename foldername |
||
| 36 | </code></pre> |
||
| 37 | |||
| 38 | to untar |
||
| 39 | <pre><code class="bash"> |
||
| 40 | tar -pxvzf tarfilename |
||
| 41 | </code></pre> |
||
| 42 | |||
| 43 | the example will tar the folder @abc@ to the archive @abc.tar.gz@: |
||
| 44 | <pre><code class="bash"> |
||
| 45 | tar -pcvzf abc.tar.gz abc |
||
| 46 | </code></pre> |