Skip to content

Short 3

Andrea Telatin edited this page Dec 4, 2019 · 3 revisions

◀️ Programme

Program pipes

With program pipes we can make use of the Linux programming philosophy: each program performs a small task and they can be chained using the | (pipe) operator. The first program output is used as input for the second program and so and forth.

Example: the output of cat is fed into wc that will print the number of lines of the file:

cat ~/learn_bash/phage/vir_genomic.gff  | wc -l

Or we can count the number of sequences in a FASTA file:

grep '>' ~/learn_bash/phage/vir_protein.faa  | wc -l

Redirection

We can save the output of a program into a text file using the > redirection operator:

grep '>' ~/learn_bash/phage/vir_protein.faa  > ~/course/vir_headers.txt

Menu

Clone this wiki locally