faOneRecord in.fa recordName
This tool is part of UCSC Genome Browser's utilities.
faOneRecord
extracts one record from the input FASTA file, if you want to extract multiple sequences from a FASTA file, you can try faFilter
.
In the following example, we will use faOneRecord to extract sequence for chromosome 1 (chr1) from human reference genome hg38:
$ faOneRecord GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta chr1 > chr1.fa