From 0ec5ee87858ec3f17f24aab9b1fb73cf0b1124e9 Mon Sep 17 00:00:00 2001 From: Alison Meynert Date: Fri, 23 May 2025 09:56:30 -0700 Subject: [PATCH] feat: add a short example of using grep on a non-N string and showing grep -c --- episodes/04-redirection.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/episodes/04-redirection.md b/episodes/04-redirection.md index 6814cc2c..a8596b46 100644 --- a/episodes/04-redirection.md +++ b/episodes/04-redirection.md @@ -50,6 +50,19 @@ directory: $ cd ~/shell_data/untrimmed_fastq ``` +Let's look for lines that contain `ACGT`. + +```bash +$ grep ACGT SRR098026.fastq +``` + +To get only the number of lines with `ACGT`, we can use the `-c` flag. +This is useful if you are unsure about the number of lines that will be found. + +```bash +$ grep -c ACGT SRR098026.fastq +``` + Suppose we want to see how many reads in our file have really bad segments containing 10 consecutive unknown nucleotides (Ns). ::::::::::::::::::::::::::::::::::::::::: callout