OSDN Git Service

Regular updates
authorErik <erikgronwal@users.osdn.me>
Fri, 12 Aug 2022 14:55:05 +0000 (23:55 +0900)
committerErik <erikgronwal@users.osdn.me>
Fri, 12 Aug 2022 14:55:05 +0000 (23:55 +0900)
js-array.md
tar.md [new file with mode: 0644]

index 2eab3e0..1ad0be5 100644 (file)
@@ -14,6 +14,8 @@ list = [a,b,c,d,e]
 ```bash
 list[1]                 // → b
 list.indexOf(b)         // → 1
+list.lastIndexOf(b)     // → 1
+list.includes(b)        // → true
 ```
 
 ### Subsets
@@ -82,6 +84,10 @@ list.splice(2, 1)       // → [c]  list == [a,b,d,e]
 ```
 
 ```bash
+.forEach(n => ...)
+```
+
+```bash
 .find(n => ...)  // es6
 .findIndex(...)  // es6
 ```
diff --git a/tar.md b/tar.md
new file mode 100644 (file)
index 0000000..2c1d27a
--- /dev/null
+++ b/tar.md
@@ -0,0 +1,46 @@
+---
+title: tar
+category: CLI
+layout: 2017/sheet
+updated: 2022-08-11
+intro: Concatenate, Deflate, Inflate files
+---
+## Reference
+{:.-two-column}
+
+### Deflate / Inflate / Concatenate
+```shell
+# Deflate / Compress
+tar -czf archive.tar.gz /path/files
+```
+
+```shell
+# Inflate / Uncompress
+tar -xzf archive.tar.gz
+```
+
+```shell
+# Concatenate files into a single tar
+tar -cf archive.tar /path/files
+```
+
+```shell
+# Extract file to a defined directory
+tar -xzf archive.tar.gz -C /target/directory
+```
+
+```shell
+# Append a file to an existing archive
+tar -zu archive.tar.gz -C /target/file
+```
+
+### Common options
+
+| Option | Description                                                              |
+|--------|--------------------------------------------------------------------------|
+| `z`    | compress with gzip                                                       |
+| `c`    | create an archive                                                        |
+| `u`    | append files which are newer than the corresponding copy ibn the archive |
+| `f`    | filename of the archive                                                  |
+| `v`    | verbose, display what is inflated or deflated                            |
+| `a`    | unlike of `z`, determine compression based on file extension             |