摘要: 001、 [root@pc1 test]# ls data gene.txt [root@pc1 test]# cat gene.txt ## 文本 gene1 gene2 gene3 [root@pc1 test]# tree . ├── data └── gene.txt 1 directory 阅读全文
posted @ 2023-01-05 17:57 小鲨鱼2018 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@pc1 test]# ls [root@pc1 test]# touch test{1..5} [root@pc1 test]# ls test1 test2 test3 test4 test5 [root@pc1 test]# ls test* | xargs mv {} { 阅读全文
posted @ 2023-01-05 17:45 小鲨鱼2018 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@pc1 test]# for (( i = 1; i <= 5; i++)); do echo $i; done 1 2 3 4 5 阅读全文
posted @ 2023-01-05 17:35 小鲨鱼2018 阅读(21) 评论(0) 推荐(0) 编辑
摘要: linux中 | 可以匹配 | 两边的任意一项。 测试: [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt ## 测试数据 Octkkk 889 Oct1st 434 Oct2nd 442 Oct2nd 4kk Oct3nd 777 [root 阅读全文
posted @ 2023-01-05 17:29 小鲨鱼2018 阅读(47) 评论(0) 推荐(0) 编辑
摘要: () 将括号中的内容视为一个整体。 001、 测试: [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt ## 测试数据 123abc456 123abcabc456 123abcabcabc456 123abcabcabcabc456 [roo 阅读全文
posted @ 2023-01-05 17:22 小鲨鱼2018 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 001、{n}; 匹配之前的项 n 次; [0-9]{3}能够匹配任意的三位数,[0-9]{3}可以扩展为[0-9][0-9][0-9]。 测试: [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt ## 测试数据 ab123cdef 88 ab 阅读全文
posted @ 2023-01-05 16:53 小鲨鱼2018 阅读(959) 评论(0) 推荐(0) 编辑
摘要: 001、?表示匹配0次或者1次 atcg?t 能够匹配 atct 或 atcgt,但是不能匹配 atcggt。 测试: [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt atct 888 atcggk 333 atcgt 444 atcgggk 阅读全文
posted @ 2023-01-05 16:30 小鲨鱼2018 阅读(2066) 评论(0) 推荐(0) 编辑
摘要: [^] :匹配不在中括号内的任意一个字符。 中括号内可以是一个字符组或字符范围; 1[^01]能够匹配 12 和 13,但是不匹配 11 和 10;A[^0-9]匹配 A 以及随后除数字外的任意单个字符。 awk正则测试: [root@pc1 test]# ls a.txt [root@pc1 te 阅读全文
posted @ 2023-01-05 16:11 小鲨鱼2018 阅读(656) 评论(0) 推荐(0) 编辑
摘要: 001、直接使用双引号输出 [root@pc1 test2]# echo "hello world!" ## 双引号输出感叹号报错 -bash: !": event not found 002、测试转义字符 [root@pc1 test2]# ls [root@pc1 test2]# echo "h 阅读全文
posted @ 2023-01-05 15:51 小鲨鱼2018 阅读(538) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@pc1 test]# a="abc" [root@pc1 test]# b="abcde" [root@pc1 test]# echo $a abc [root@pc1 test]# echo $b abcde [root@pc1 test]# echo ${#a} ## 输出 阅读全文
posted @ 2023-01-05 14:53 小鲨鱼2018 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt d iy 5f er sd 34 d8 3f dg dg xe j7 [root@pc1 test]# sed 's/\S\+/KKK/' a.txt ## 第一列 KKK iy 5f 阅读全文
posted @ 2023-01-05 09:02 小鲨鱼2018 阅读(2196) 评论(0) 推荐(0) 编辑