From f078b33b6b4ee7d07d8efaabff8bb0e7f4108d97 Mon Sep 17 00:00:00 2001 From: trimstray Date: Mon, 23 Jul 2018 14:47:54 +0200 Subject: [PATCH] updated README.md - signed-off-by: trimstray --- README.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index afd87c1..9cf1644 100644 --- a/README.md +++ b/README.md @@ -443,16 +443,16 @@ column -c3 -s " " -t | \ sort -nr | nl | head -n 20 ``` -###### Empty a file (truncate to 0 size) +###### Quickly backup a file ```bash ->filename +cp filename{,.orig} ``` -###### Quickly backup a file +###### Empty a file (truncate to 0 size) ```bash -cp filename{,.orig} +>filename ``` ###### Delete all files in a folder that don't match a certain file extension @@ -461,6 +461,16 @@ cp filename{,.orig} rm !(*.foo|*.bar|*.baz) ``` +###### Pass multi-line string to a file + +```bash +# cat >filename ... - overwrite file +# cat >>filename ... - append to file +cat > filename << __EOF__ +data data data +__EOF__ +``` + ###### Edit a file on a remote host using vim ```bash @@ -1039,6 +1049,12 @@ dd status=progress watch --interval 5 killall -USR1 dd ``` +###### Redirect output to a file with dd + +```bash +echo "string" | dd of=filename +``` + HTTP/HTTPS ##### Tool: [curl](https://curl.haxx.se)