paste 可以列合并文件,cat可以行合并文件
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat test.txt
this
is
a
test
o
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat test1.txt
this
is
a
test
o
haha
aja
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ paste test.txt test1.txt > all_test.txt
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat all_test.txt
this this
is is
a a
test test
o o
haha
aja
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat test.txt test1.txt > cat_all_test.txt
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat c
cat_all_test.txt combined_reads.bam
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat cat_all_test.txt
this
is
a
test
o
this
is
a
test
o
haha
aja
在管道中paste还有妙用,合并N行显示
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat test.txt | paste - - -
this is a
test o
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat test.txt | paste - - - -
this is a test
o
(base) yjk@DESKTOP-U8UULFU:~/test/bowtie2-2.4.1-linux-x86_64/example/reads$ cat test.txt | paste - - - - -
this is a test o
还可以一行命令转fastq为fasta
cat file.txt | paste - - - - | cut -f1-2 |tr '@' '>' | tr '\t' '\n'
网友评论