<p>Use either generic *NIX <code>cut</code> (you do not need a delimiter if you use <code>-c</code> option) or <code>head</code> tools. Even better, use any of a number of bioinformatics tools for sequence manipulation, such as EMBOSS <code>extractseq</code>.</p>
<p><strong>EXAMPLES:</strong></p>
<pre><code># Write into file output.txt characters 1-20 from each line of file input.txt:
cut -c1-20 input.txt &gt; output.txt

# Write the first 5 lines of input.txt:
head -n5 input.txt &gt; output.txt

# It is easier if you have your sequence in fasta format.
# Write characters 1..20 and 100-110 from input.fasta to output.fasta:
extractseq input.fasta output.fasta -regions &quot;1-20 100-110&quot; 
</code></pre>
<hr />
<p>One of the easy ways to install EMBOSS suite is using <code>conda</code> (from bioconda channel).</p>
<p><strong>SEE ALSO:</strong></p>
<p>EMBOSS <code>extractseq</code> help: <a href="https://www.bioinformatics.nl/cgi-bin/emboss/help/extractseq" rel="nofollow noreferrer">https://www.bioinformatics.nl/cgi-bin/emboss/help/extractseq</a></p>

CC BY-SA 4.0
2020-08-08T20:32:16.893Z
2020-08-08T20:32:16.893Z
Timur Shtatland
<p>I need to use the cut command on a human insulin sequence row wise but i don't know the command.I already ran byte wise command but the gave me column wise results. I cant use the -f option since i need to use a delimiter with it and the seq does not have any delimiters.
please answer asap</p>

CC BY-SA 4.0
2020-08-08T13:41:41.603Z
Could you please show the commands you tried so far and how the result should looks like? If you could give a simple example of how your data, it would be a good help to understand your problem.
Mr_Z
CC BY-SA 4.0
2020-08-10T10:37:46.950Z
`cut` is a linux command, but might not do what you intend. Could you please describe your problem with greater clarity?
M__
CC BY-SA 4.0
2020-08-12T08:19:03.460Z
I have an assignment where i have to use Linux commands on a bioinformatics problem i choose  to cut sort and uniq the sequence. however the cut command worked for byte wise cutting but not field wise since fields dont exist in a seq. also can someone tell me why do we sort a seq because wouldn't that result in a mutation.
Nargis Naqvi
<linux>
DNA seq cutting using Linux
# DNA seq cutting using Linux

(Asked by: username_0 on 2020-08-08)

I need to use the cut command on a human insulin sequence row wise but i don't know the command.I already ran byte wise command but the gave me column wise results. I cant use the -f option since i need to use a delimiter with it and the seq does not have any delimiters.
please answer asap

**Tags:** linux
> **Comments:**
> **username_1**: Could you please show the commands you tried so far and how the result should looks like? If you could give a simple example of how your data, it would be a good help to understand your problem.  
> **username_2**: `cut` is a linux command, but might not do what you intend. Could you please describe your problem with greater clarity?  
> **username_0**: I have an assignment where i have to use Linux commands on a bioinformatics problem i choose  to cut sort and uniq the sequence. however the cut command worked for byte wise cutting but not field wise since fields dont exist in a seq. also can someone tell me why do we sort a seq because wouldn't that result in a mutation.  

---

## 1 answers

### Answer by username_3 on 2020-08-08. Score: 0 | Accepted answer

Use either generic *NIX cut (you do not need a delimiter if you use -c option) or head tools. Even better, use any of a number of bioinformatics tools for sequence manipulation, such as EMBOSS extractseq.
EXAMPLES:
# Write into file output.txt characters 1-20 from each line of file input.txt:
cut -c1-20 input.txt > output.txt

# Write the first 5 lines of input.txt:
head -n5 input.txt > output.txt

# It is easier if you have your sequence in fasta format.
# Write characters 1..20 and 100-110 from input.fasta to output.fasta:
extractseq input.fasta output.fasta -regions "1-20 100-110" 


One of the easy ways to install EMBOSS suite is using conda (from bioconda channel).
SEE ALSO:
EMBOSS extractseq help: https://www.bioinformatics.nl/cgi-bin/emboss/help/extractseq


---

