mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-04 00:15:32 +02:00
expr, bzip2: add page. iptables: fix typo (#827)
This commit is contained in:
parent
217a96797b
commit
b3fb312afc
3 changed files with 39 additions and 1 deletions
15
pages/linux/bzip2.md
Normal file
15
pages/linux/bzip2.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# bzip2
|
||||
|
||||
> A block-sorting file compressor.
|
||||
|
||||
- Compress file:
|
||||
|
||||
`bzip2 {{path/to/file_to_compress}}`
|
||||
|
||||
- Decompress file:
|
||||
|
||||
`bzip2 -d {{path/to/compressed_file.bz2}}`
|
||||
|
||||
- Decompress to STDOUT:
|
||||
|
||||
`bzip2 -dc {{path/to/compressed_file.bz2}}`
|
23
pages/linux/expr.md
Normal file
23
pages/linux/expr.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# expr
|
||||
|
||||
> Evaluate expressions and manipulate strings.
|
||||
|
||||
- Get string length:
|
||||
|
||||
`expr length {{string}}`
|
||||
|
||||
- Evaluate logical or math expression with an operator( '+', '-', '*', '&', '|', etc. ). Special symbols should be escaped:
|
||||
|
||||
`expr {{ARG1}} {{operator}} {{ARG2}}`
|
||||
|
||||
- Get position of the first character in 'string' that matches 'substring':
|
||||
|
||||
`echo $(expr index {{string}} {{substring}})`
|
||||
|
||||
- Extract part of the string:
|
||||
|
||||
`echo $(expr substr {{string}} {{position_to_start}} {{number_of_characters}}`
|
||||
|
||||
- Extract part of the string which matches a regular expression:
|
||||
|
||||
`echo $(expr {{string}} : '\({{regular_expression}}\)')`
|
|
@ -22,6 +22,6 @@
|
|||
|
||||
`sudo iptables -D {{chain}} {{rule_line_number}}`
|
||||
|
||||
- Savin iptables configuration:
|
||||
- Save iptables configuration:
|
||||
|
||||
`sudo iptables-save > {{path_to_iptables_file}}`
|
||||
|
|
Loading…
Add table
Reference in a new issue