我正在运行以下命令:
grep "folder1/folder2/folder3/.\*/results/.*.vcf.gz" some_file.txt |grep ".vcf.gz$" > vcffiles.txt
和我在vcffiles.txt文件中的输出是这样
folder1/folder2/folder3/folder4.1/results/B111.vcf.gz
folder1/folder2/folder3/folder4.2/results/B112.vcf.gz
folder1/folder2/folder3/folder4.1/folder6/folder7/results/B122.vcf.gz
folder1/folder2/folder3/folder4.1/folder6/folder7/folder8/results/B123.vcf.gz
我只想要前两行,而不想要后两行。如何修复此代码以获取所需的信息?
答案 0 :(得分:0)
您可以使用其他过滤器从结果中删除不需要的行。
... | grep -v "folder[678]"