I have a command line like this:
awk '$9 < 0.1' s_all_frq.txt | wc -l
awk '$9 >= 0.1 && $9 < 0.2 ' s_all_frq.txt | wc -l
when I run it I get an output like this.
$ awk '$9 < 0.1' s_all_frq.txt | wc -l
63278
$awk '$9 >= 0.1 && $9 < 0.2 ' s_all_frq.txt | wc -l
2346
when I try to save this in a text file it always replace the first output. so I use these commands:
awk '$9 < 0.1' s_all_frq.txt | wc -l > 1.txt
awk '$9 >= 0.1 &&$9 < 0.2 ' s_all_frq.txt | wc -l > 1.txt
and I get only 2346 saved on the text file. which I assume that the file got overwritten. I wonder if it’s possible to add something to this command to save the output as new line in the file so I will have this in the final file:
63278
2346
Use
>>instead of>to append instead of replace.Other example: