Skip to content

Commit 7235863

Browse files
authored
Merge pull request #365 from datacarpentry/clarification/grep_example
feat: add a short example of using grep on a non-N string and showing `grep -c`
2 parents 684fb04 + 0ec5ee8 commit 7235863

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

episodes/04-redirection.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ directory:
5050
$ cd ~/shell_data/untrimmed_fastq
5151
```
5252

53+
Let's look for lines that contain `ACGT`.
54+
55+
```bash
56+
$ grep ACGT SRR098026.fastq
57+
```
58+
59+
To get only the number of lines with `ACGT`, we can use the `-c` flag.
60+
This is useful if you are unsure about the number of lines that will be found.
61+
62+
```bash
63+
$ grep -c ACGT SRR098026.fastq
64+
```
65+
5366
Suppose we want to see how many reads in our file have really bad segments containing 10 consecutive unknown nucleotides (Ns).
5467

5568
::::::::::::::::::::::::::::::::::::::::: callout

0 commit comments

Comments
 (0)