add the old snippet md files
This commit is contained in:
parent
fc0dd204c7
commit
bcf8313a4b
110 changed files with 3048 additions and 0 deletions
23
old_snippets/list-tar-contents.md
Normal file
23
old_snippets/list-tar-contents.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: "list tar contents"
|
||||
date: 2021-06-13T08:31:14+02:00
|
||||
draft: false
|
||||
snippet_types:
|
||||
- tar
|
||||
---
|
||||
|
||||
Before putting a tar file somewhere hard to access like S3 Glacier I note what is in it. I create a manifest file. Simply list the file names within:
|
||||
|
||||
```shell
|
||||
$ tar tvf example.tar
|
||||
```
|
||||
|
||||
With more automation worked in I came up with this:
|
||||
|
||||
- list all the tar files using fd (rust find replacment)
|
||||
- list content of each one
|
||||
- pipe that into a file for safe keeping
|
||||
|
||||
```shell
|
||||
$ for x in $(fd -e tar) ; do (tar tvf "$x" && echo "\n") ; done > /tmp/example_manifest
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue