Search for a patternstep 1 of 4 · beginner
Support
The command is shown. Click it to run, or type your own.
By the end of this lesson you can
- Print lines matching a pattern with
grep PATTERN FILE - Count matches instead of printing them with
grep -c - Match whole words (
-w) and ignore case (-i) - Use
grepas a filter inside a pipeline
Before you startPipes and filters: the pipe | and the cut | sort | uniq -c idiom.
grep PATTERN FILE prints every line of the file that contains the pattern. Let's find the missense variants.
Find every line mentioning missense in variants.tsv.
the file
chr1 BRCA1 HIGHchr2 EGFR LOWchr1 TP53 HIGHchr3 MYC MODERATEgrep HIGHwhat you get
chr1 BRCA1 HIGHchr1 TP53 HIGHNote
The name grep comes from an old text editor command, g/re/p, globally search a regular expression and print. Once you learn regular expressions, that same pattern language works in grep, sed, awk, and most programming languages.
Type a command, or click the suggested one. ↑/↓ recall history, Tab completes file names. New to this? Hit Explain this command to see it in plain English.
workspace/shared/data0 files
Booting the WebAssembly runtime…