Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleExample grep commands
# Count the total number of contigs:
grep -c "^>" single_end/contigs.fa



# Determine the length of the 5 largest contigs:
grep "^>" single_end/contigs.fa | head -n 5


# Determine the length of the 20 smallest contigs:
grep "^>" single_end/contigs.fa | tail -n 20


# Determine the length of the 100th through 110th contigs:
grep "^>" single_end/contigs.fa | head -n 110 | tail -n 10

...