Commit ed9266fa authored by Vincent Tam's avatar Vincent Tam

Added some new commands

parent 9e640f21
Pipeline #58859479 passed with stages
in 37 seconds
......@@ -106,6 +106,11 @@ It can be used to extract Git remote URL from
It's a sequence of `/PAT/ {ACTION}`. At most _one_ of these two can be omitted.
I suggest `man mawk` for a concise user guide. Things are executed
_record-wise_, and the record separator (RS) is, by default, the newline
_character. By setting this to the empty string, RS becomes an empty line.
### bash
GNU's **B**ourne-**a**gain **sh**ell. Use this with `-c [CMD]` to execute a
......@@ -800,6 +805,10 @@ ago. `n` should be an integer.
| `time` | days |
| `min` | minutes |
- can be used with
find . -print0 | while IFS= read -d '' -r file; do ...; done
### git
The most popular VCS (version control system). Here's a _minimal_ collection of
......@@ -1122,6 +1131,10 @@ explanations: (in alphabetical order)
- `-w`: match whole _word_, similar to `\<` and `\>` in [Vim].
- `-q`: quiet
<i class="fas fa-exclamation-triangle fa-fw" aria-hidden></i>
`grep` _doesn't_ work for multi-line regex match. Use [`sed`](#sed) or
[`awk`](#awk) instead.
### head
Print first `n` lines of a file or STDOUT. (`n = 10` by default) Works like
......@@ -1458,7 +1471,7 @@ class="fa fa-terminal fa-stack-1x"></i></span> TTY session into a text file
aria-hidden></i> <i class="fas fa-sort-alpha-down fa-fw" aria-hidden></i> Flags
explanations: (in alphabetical order)
- `-e`: extended mode
- `-e`: extended mode, use for multiple expressions
- `-i`: in place editing
- `-n`: no normal output
......@@ -1489,6 +1502,24 @@ explanations: (in alphabetical order)
A `[range]` can be inverted by `!`, so `sed '$!d'` works like `tail -1`.
Some common `[cmd]`:
- `a`: **a**ppend
- `d`: **d**elete
- `n`: **n**ext: clear pattern space (PS) and go to next line
- `p`: **p**rint
- `{...}`: can be used with pattern like `/PAT/{n;p}` for conditional
`[cmd]`'s are separated by semicolon `;`.
Some less common `[cmd]`:
- `N`: go to next line, but append newline ↵ and next line to PS, useful for
multi-line regex match.
- `q`: **q**uit, allows setting status number
- `x`: e**x**change PS and hold space (HS), can be used to detect if the text
has been changed.
### shrinkpdf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment