From 4207cebf4914b3d07d793bd68327716171d5e93c Mon Sep 17 00:00:00 2001 From: Omar Hamad Date: Thu, 11 Nov 2021 11:41:51 +0200 Subject: [PATCH 1/2] linux: Add grep command explanation (#176) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fc79b47..085cc13 100644 --- a/README.md +++ b/README.md @@ -638,6 +638,9 @@ They take in input (<) and output for a given file (>) using stdin and stdout.
- sed: a stream editor. Can be used for various purposes like replacing a word in a file: `sed -i s/salad/burger/g` + - grep: a search tool. Used to search, count or match a text in a file: + - searching for any line that contains a word in a file: `grep 'word' file.md` + - or displaying the total number of times a string appears in a file: `grep -c 'This is a string' file.md`
From 5b589faffb4adc9c893757d992bba6b0a904021a Mon Sep 17 00:00:00 2001 From: Omar Hamad Date: Fri, 12 Nov 2021 14:04:38 +0200 Subject: [PATCH 2/2] linux: Add cut command explanation (#177) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 085cc13..3bab197 100644 --- a/README.md +++ b/README.md @@ -641,6 +641,9 @@ They take in input (<) and output for a given file (>) using stdin and stdout. - grep: a search tool. Used to search, count or match a text in a file: - searching for any line that contains a word in a file: `grep 'word' file.md` - or displaying the total number of times a string appears in a file: `grep -c 'This is a string' file.md` + - cut: a tool for cutting out selected portions of each line of a file: + - syntax: `cut OPTION [FILE]` + - cutting first two bytes from a word in a file: `cut -b 1-2 file.md`, output: `wo`