5,337
edits
(→grep) |
No edit summary |
||
Line 26: | Line 26: | ||
* <code>2>&1</code> will redirect stderr (2) to stdout (1) | * <code>2>&1</code> will redirect stderr (2) to stdout (1) | ||
* [https://www.gnu.org/software/coreutils/manual/html_node/tee-invocation.html <code>tee</code>] will redirect stdout to multiple files and show it in the terminal | * [https://www.gnu.org/software/coreutils/manual/html_node/tee-invocation.html <code>tee</code>] will redirect stdout to multiple files and show it in the terminal | ||
==Package Management== | ==Package Management== | ||
Line 407: | Line 365: | ||
;Unzip an archive | ;Unzip an archive | ||
<code>unzip file.zip [-d destination]</code> | <code>unzip file.zip [-d destination]</code> | ||
===diff=== | |||
[https://www.geeksforgeeks.org/diff-command-linux-examples/ diff examples] | |||
;Important flags | |||
* <code>--strip-trailing-cr</code> Ignores <code>\r</code> | |||
===tar=== | |||
;Extraction | |||
<pre> | |||
tar xzvf archive.tar.gz | |||
</pre> | |||
;Archive | |||
<pre> | |||
tar czpvf archive.tar.gz files | |||
</pre> | |||
;Flags | |||
* <code>-x</code> extract preserving paths | |||
* <code>-p</code> preserve permissions | |||
* <code>-c</code> create an archive | |||
* <code>-f</code> specify file | |||
;Compression formats | |||
* <code>-z</code> use gzip | |||
* <code>-j</code> use bzip2 | |||
* <code>-J</code> use xz | |||
===find=== | |||
Find files by their filename | |||
<pre> | |||
find <folder> [args] -name <name> | |||
</pre> | |||
* <code>-maxdepth <num></code> | |||
===grep=== | |||
Find files containing a pattern | |||
<pre> | |||
grep -r <pattern> * | |||
</pre> | |||
==Dual Booting== | ==Dual Booting== |