filename Usage: grep [options] “pattern” Command Function Example Usage Grep Searches for lines in the file grep “GENE” annotation.gff containing the search pattern grep Same as grep but is not case grep -i of –i “$think something” $_ sensitive grep Counts the number of times the grep -c proteins.fasta –c “>” pattern appears grep -An Prints the line matching the pattern grep -A1 “scaffold1” genome.fasta and n lines after the pattern First , make a new folder from your home directory, move into it, and then copy the Maker control and other sample files from our shared directory into your directory. $mkdir 6_grepBlast $cd 6_grepBlast $cp /share/apps/sharedData/GCAT/6_grepBlast/* . The file apples.txt contains: APPLE pineapple apples Run: $grep “APPLE” apples.txt grep finds and will print: “APPLE” APPLE Using makes a search not case sensitive. Predict what the following will return, and then “grep –i” run the command: $grep -i “APPLE” apples.txt The option will count the number of lines the pattern appears in a file. This is very 4. “$grep –c” useful for counting the number of sequences in a multifasta file. Open up (using nano) the fasta file below, named “test1.fa” >scaffold_0
Usage: grep [options] “pattern” filename Command Function Example Usage Grep Searches for lines in the file containing the search pattern grep “GENE” annotation.gff grep –i Same as grep but is not case sensitive grep -i “$think of something” $_ grep –c Counts the number of times the pattern appears grep -c “>” proteins.fasta grep -An Prints the line matching the pattern and n lines after the pattern grep -A1 “scaffold1” genome.fasta First , make a new folder from your home directory, move into it, and then copy the Maker control and other sample files from our shared directory into your directory. $mkdir 6_grepBlast $cd 6_grepBlast $cp /share/apps/sharedData/GCAT/6_grepBlast/* . The file apples.txt contains: APPLE pineapple apples Run: $grep “APPLE” apples.txt grep finds “APPLE” and will print: APPLE Using “grep –i” makes a search not case sensitive. Predict what the following will return, and then run the command: $grep -i “APPLE” apples.txt 4. The option “$grep –c” will count the number of lines the pattern appears in a file. This is very useful for counting the number of sequences in a multifasta file. Open up (using nano) the fasta file below, named “test1.fa” >scaffold_0