Unix command

unix命令积累

Posted by Yichen Yang on April 18, 2019

Unix command

1) 提取 water/pbsa/文件下的DELTA TOTAL

1
grep -Hn 'DELTA TOTAL' water*/pbsa*/FINAL_RESULTS_MMPBSA.dat > result.txt

2) 查看GPU资源: nvidia-smi

3) 快速查看行数 wc -l ,对应的python语句为len([ "" for line in open("a.txt","r")])

4) 脱机跑任务 nohup python a.py &

5) 查看环境变量source activate env有多少,用conda info --env

6)去重,第四列数值 awk -F '\t' '!c[$4]++' c.txt > d.txt

7) 查看逻辑CPU的个数 cat /proc/cpuinfo| grep "processor"| wc -l

8)查看各文件大小 du -sh * | sort -n

9)vim调试代码(when-changed) when-changed -v '6_data_clean.py' python 6_data_clean.py

10)批量结束进程 ps -ef|grep clean|grep -v grep|cut -c 9-15|xargs kill -9

11) 新环境 conda create -n Tian python=3.6.8