代码改变世界

Serveral effective linux commands

2018-06-01 10:45  丨o聽乄雨o丨  阅读(378)  评论(0编辑  收藏  举报

1. 统计当前文件夹下文件个数(不包括子目录下文件):

$ ls -l | grep "^-" | wc -l

2. 统计当前文件夹下文件个数(包括子目录下文件):

$ ls -lR| grep "^-" | wc -l

3. 查看某目录下文件夹(目录)的个数(包括子目录):

$ ls -lR | grep "^d" | wc -l

4. 查看特定用户提交的命令及PID等数据,并使用kill杀线程:

$ ps -U usrname -u usrname u
$ kill PID

 5. 查看当前中断运行的(后台)命令:

$ jobs

6. 查看所有命令,查找执行的命令:

$ ps -aux | grep rsync
$ htop
$ top

7. AF2建模后处理:

$ for fasta in *fasta; do if [ -e ~/Workfile/Alphafold2_Output/${fasta%.fasta}/ranked_0.pdb ];then echo $fasta; cp ~/Workfile/Alphafold2_Output/${fasta%.fasta}/ranked_0.pdb ${fasta%.fasta}.pdb; rm -rf ~/Workfile/Alphafold2_Output/${fasta%.fasta}/msas; rm ~/Workfile/Alphafold2_Output/${fasta%.fasta}/*.pkl; fi; done