Skip to content

Commit 0ec5ee8

Browse files
committed
feat: add a short example of using grep on a non-N string and showing grep -c
1 parent abe09c2 commit 0ec5ee8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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)