clean up old formatting

This commit is contained in:
2026-04-27 13:13:22 +02:00
parent ea4f44e096
commit 319ae8df79
11 changed files with 39 additions and 28 deletions

View File

@@ -10,7 +10,7 @@ tags:
Combine many files and directories into a single t-archive file.
```sh
tar cf "$ARCHIVE".tar $DIR
tar cf "${archive}".tar ${dir}
```
You can remember this with the mnemonic '*C*reate *F*ile'.
@@ -18,13 +18,13 @@ Unfortunately, this stores the full file path, so making a tar archive of `/etc/
It's often better to tell tar which path to start from using the `-C` flag.
```sh
tar cf "$ARCHIVE".tar -C /etc/ nginx
tar cf "${archive}".tar -C /etc/ nginx
```
Check the contents of your archive with:
```sh
tar tf "$ARCHIVE".tar
tar tf "${archive}".tar
```
If you want to store 'everything in a directory', then using `*` will not work, because it will target everything in the *current* directory.
@@ -33,7 +33,7 @@ Instead, you can store the target in a variable:
```sh
files=$(ls /etc/nginx)
tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
tar cf "${archive}".tar -C /etc/nginx/ $file
```
# Extract
@@ -41,7 +41,7 @@ tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
Extract the tar archive with
```sh
tar xf "$ARCHIVE".tar
tar xf "${archive}".tar
```
You can remember this with the mnemonic 'e*X*tract *F*ile'.
@@ -51,7 +51,7 @@ You can remember this with the mnemonic 'e*X*tract *F*ile'.
Create a zip-compressed archive with the `z` flag.
```sh
tar czf "$ARCHIVE".tgz -C /etc/nginx/ $file
tar czf "${archive}".tgz -C /etc/nginx/ $file
```
You can use any file ending you want, but sane people like to use '.tgz' or '.tar.tgz'.