随笔分类 - linux shell
摘要:001、 (base) [b20223040323@admin1 test]$ ls a.txt b.txt (base) [b20223040323@admin1 test]$ cat a.txt ## 测试数据 GENE=3BHSD 1 1 GENE=A3GALT2 1 1 GENE=A1BG
阅读全文
摘要:今天遇到一个小问题,要提取文件的行首和行尾指定的行数, 不想生成中间文件, 一时没有想出来怎么处理,后来想到一个组合命令实现。如下: 001、 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试数据 01 02 03 04 05
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt b.txt [root@PC1 test]# cat a.txt ## 测试数据a.txt gene exon gene exon exon exon exon [root@PC1 test]# awk 'BEGIN{idx=0} {if
阅读全文
摘要:001、yum安装软件出现如下报错 002、其中的一个原因是 python的版本造成的,即将系统默认调用的python有python2改用了python3, 而yum命令兼容的python版本是python2,因此解决方法是将yum调用的python改为2,及修改yum下载器中的python调用路径
阅读全文
摘要:001、系统为centos7.6 [root@PC1 test]# cat /etc/system-release CentOS Linux release 7.6.1810 (Core) 002、默认可以调用的python版本为2.7 [root@PC1 test]# python --versi
阅读全文
摘要:001、 系统 root@ubuntu01:/etc/netplan# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04
阅读全文
摘要:001、q,表示退出(匹配地址后退出sed脚本) [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 22 jj yy ss ff xx zz vv bb dd 00 ss 99 cc mm bb tt yy [root@PC1
阅读全文
摘要:001、指定列的输入分隔符 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt aa:bb:cc 11:22:33 55:88:33 [root@PC1 test]# awk -F ":" '{print $2}' a.txt ## 使用-F 选
阅读全文
摘要:001、 ctrl + a: 将光标移动到命令行的开头,相当于键盘中的home键 002、 ctrl + e: 将光标移动到命令行的结尾,相当于键盘中的end键 003、ctrl + u: 剪切光标所在位置之前的内容 004、ctrl + k: 剪切光标所在位置之后的内容 005、ctrl + y:
阅读全文
摘要:001、普通数组 普通数组的定义: ay=(100 200 300 "aa" "bb") ## 直接定义 [root@PC1 test]# ay2[0]=800 ## 单独定义每一个元素 [root@PC1 test]# ay2[1]="aaaa" [root@PC1 test]# ay2[2]=5
阅读全文
摘要:001、 [root@PC1 test]# ls test.sh [root@PC1 test]# cat test.sh ## 测试脚本 #!/bin/bash read -p "please input an character:" key ## 给变量key赋值 case $key in ##
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a b c 3 d b e 7 a d e 8 z b c 4 a d e 1 [root@PC1 test]# awk '{array[$2] += $4} END
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bb kk aa qq kk 11 kk dd kk mm xx [root@PC1 test]# cat -A a.txt ## 可以看到有tab制表符 aa^
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bb cc dd 11 22 33 [root@PC1 test]# cat -A a.txt ## cat -A , tab键显示为^I aa bb^Icc^I
阅读全文
摘要:001、 [b20223040323@admin1 test]$ ls test.fa [b20223040323@admin1 test]$ cat test.fa ## 测试数据 >chr1 aabbccdd eeff >chr2 xxyyzzqq gg >chr3 ddjjiill ssff
阅读全文
摘要:001、 root@ubuntu01:/home/test# ls a.txt root@ubuntu01:/home/test# cat a.txt ## 测试数据 2,7 3.23 72 3!8\34 34+3 444 root@ubuntu01:/home/test# awk '{print
阅读全文
摘要:001、 利用awk语句判断 root@ubuntu01:/home/test# ls a.txt b.txt root@ubuntu01:/home/test# cat a.txt 1 2 3 4 root@ubuntu01:/home/test# cat b.txt 1 1 1 1 root@u
阅读全文
摘要:001、https://www.cnblogs.com/yukina/p/16821631.html
阅读全文
摘要:001、首先找到vim的安装目录,这里是: /public/home/b20223040323/software/vim_dir/share/vim/vim90 002、对defaults.vim文件进行编辑 在末尾增加 :set mouse=r echo "set mouse=r" >> defa
阅读全文
摘要:001、 [b20223040323@admin1 test]$ ls a.txt [b20223040323@admin1 test]$ cat a.txt ## 测试数据 d_j j k d d_kk [b20223040323@admin1 test]$ cat a.txt | while r
阅读全文