####### 拆分文件 按行
split -l 2000 pathway_wget.list split.list #### 将一个文件按行拆分 2000个一行
[liujun@public-fatnode1-15 pathway]$ ls
get_K_pathway.py split.listaa split.listac split.listae split.listag
pathway_wget.list split.listab split.listad split.listaf
########## 批量修改文件名
#!/bin/bush
#name="JA"
#name="SA"
#name="ABA"
#name="ETH"
for file in `ls|grep 'H2O'`
do
new="${name}_${file}" ###如果不加“” 不显示$name
echo $new
mv $file $new
done
#######rename 命令更方便
rename 's/.txt/.new.txt/g' ./*.txt. #把当前所有txt结尾的文件名改为.new.txt
##########
awk '{if ($9=="u"||$9=="i"||$9=="x"||$9=="o")print $0 > "new1.txt";else if ($9=="=")print$0 > "new2.txt";else print $0 > "new3.txt"}' test.txt
awk '{if ($4~"AET")print $0 > "old_gene.txt";else print $0 > "new_gene.txt"}' gene.txt
awk '{if($7 == ".")print $0 > "filtered.txt";else print $0 > "cuffcmp.combined.filter.gtf"}' cuffcmp.combined.gtf
########## qdel所有自己的任务
qstat -u liujun|grep 'NIP'>qdel.txt
cat qdel.txt |tr " " "\t"|cut -f 1 > id.txt
cat id.txt|while read i;do qdel $i;done
############ 隔行判断
$ awk '{print NR/NR%4/NR%4==2,$0}' NIP-L-0H-2.fq|head
1 1 0 @A00881:189:HJ3MNDRXX:1:2101:29496:1344 1:N:0:AAGAGATC
2 2 1 TTCCACAGCTTTCTTGAACTT
3 3 0 +
4 0 0 FFFFFFFFF:FFFFFFFFFFF
############ 按照某一列去重复
awk '!a[$1]++{print}' all.clean.count > new.count