shell==========================
echo 1 > /proc/sys/vm/drop_caches 清理内存 free -m
du -h --max-depth=1 folder
awk '$0 ~ ">hsa" { print $0; getline str; print str; } ' 20150417.fa
只取文件名:
ll *tsv | sed 's/.*://g' | sed 's/.* //g'
R: letters[1:26]
echo -en "\007" #beep
echo "echo -en '\007'" >> t.sh
=CHAR(96+ROW())
xxx.sh >00.logs 2>&1 &
join -a 1 file1 file2 > mergedfile
#sort the bam files by name
for f in *.bam; do samtools sort -n "$f" "${f%.*}".sorted; done
#convert bam to sam
for f in *sorted.bam; do samtools view "$f" > "${f%.*}".sam; done
#convert sam to read counts
for f in *.sam; do python -m HTSeq.scripts.count "$f" Mus_musculus.GRCm38.75.gtf > "${f%.*}".readcount.txt ; done
split -l 2000 seq_2 -d -a 2 split_ 按行拆分文件
sed '1i "geneid"' filename 插入一行内容在第一行
sed -i '1iabc' urfile 插入一行内容在第一行
-S <作业名称> 指定screen作业的名称。
grep -A 1 'EN03347' ripts.fa 输出匹配的行及其下一行
# screen -X quit 退出screen
# awk '{if(length($3)>30)print $0}' urfile
awk分割信息后获取最后一列 cat $(ll /home/sdzw/tcf/20110914_001/|awk '{print $NF}')|grep "abc"
echo "Cfoo'barxml" | sed "s/'/::/g" | sed 's/::/\\:/g' | sed "s/:/'/g" 替换单引号为 \'
rpm -qa | grep mysql // 这个命令就会查看该操作系统上是否已经安装了mysql数据库
grep -n 'key' file 显示行号
sed -n '1,5p' file
dos2unix filename 用:set ff=unix把它强制为unix格式
sed -n '100,200p' mysql_slow_query.log 只查看文件的第100行到第200行
awk '$7=="." {print $0}' merged.gtf
awk '$7!="." {print $0}' merged.gtf
find ./ -name '*extractfastabyid*' -print
grep -wq "Run complete" ERR266361.err && echo "SRR000000 tophat 运行正常; " || echo "SRR000000 tophat 运行错误; "
nohup command > myout.file 2>myerr & 使用 jobs 查看任务。使用 fg %n 关闭。
ps aux | grep pbs
pkill "pbs_*"
pbs_server
pbs_sched
pbs_mom
pbsnodes -a
echo 'sleep 20' | qsub
qmgr -c 'print server'
cat /var/spool/torque/server_name
grep 'exon_number \"1\"' /filename | wc
grep -v 'ENS4810' file 不包含ENS4810 的行
sed -e 's/abc//g' file
:set list 进入List Mode;:set nolist 退出List Mode
awk 'NR==FNR{a[FNR]=$0} NR>FNR{for(i in a)if($0~a[i]){print;getline;print}}' Aid Bfilt >Cnew
R==========================