diff --git a/pages/linux/bzip2.md b/pages/linux/bzip2.md new file mode 100644 index 0000000000..65a66a45b0 --- /dev/null +++ b/pages/linux/bzip2.md @@ -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}}` diff --git a/pages/linux/expr.md b/pages/linux/expr.md new file mode 100644 index 0000000000..378973653a --- /dev/null +++ b/pages/linux/expr.md @@ -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}}\)')` diff --git a/pages/linux/iptables.md b/pages/linux/iptables.md index ae86e2f69b..1516c92713 100644 --- a/pages/linux/iptables.md +++ b/pages/linux/iptables.md @@ -22,6 +22,6 @@ `sudo iptables -D {{chain}} {{rule_line_number}}` -- Savin iptables configuration: +- Save iptables configuration: `sudo iptables-save > {{path_to_iptables_file}}`