随笔分类 - linux shell
摘要:001、 find ./ -type f -name "*fasta" -size +100M -size -200M ## 查找文件类型未文件; 名称未最后几个字符fasta, 文件的大小大于100M, 小于200M 。
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 33 aa 44 aa 88 aa 33 aa ff kk 33 aa 88 22 mm 88 33 44 22 99 [root@PC1 test]# sed '2 s/.*/\n&
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数 aa bbb dd ff 77 dd 22 44 77 88 cc dd ee ff [root@PC1 test]# sed -n '/dd/p' a.txt ## 输
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa 33 aa 77 bb aa aa 22 aa kk cc bb dd aa uu 88 33 88 rr qq [root@PC1 test]# grep -o
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 aa bbbbbb cc bb ww xx yy zz dd jj kk mm ss [root@PC1 test]# awk '{sub("b+", "Q"); pr
阅读全文
摘要:001、Linux awk中如何删除数组 (base) [b20223040323@admin2 test]$ cut -f 5-6 rt288_2_3.bim | paste - <(cut -f 5-6 yt4_2_3.bim ) | head C A 0 A T C C T C A C A A
阅读全文
摘要:001、 -P选项表示 perl正则兼容 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 01 02 03 04 05 中国农副业 06 07 河南 08 09 10 [root@PC1 test]# cat a.txt |
阅读全文
摘要:001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 01 02 03 04 05 中国农副业 06 07 河南 08 09 10 [root@PC1 test]# cat a.txt | grep -P '[\x{4e0
阅读全文
摘要:001、grep命令报错如下 [root@PC1 test]# echo "你好世界" | grep -P '[\u4e00-\u9fff]+' grep: PCRE does not support \L, \l, \N{name}, \U, or \u 002、解决方法(把U改为x;同时中间用中
阅读全文
摘要:001、 [root@PC1 test2]# ls test.sh [root@PC1 test2]# cat test.sh ## 脚本 #!/bin/bash seq 10000000000000000000000000000000000000 &> /dev/null [root@PC1 te
阅读全文
摘要:001、方法1 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
阅读全文
摘要:001、 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试数据 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2
阅读全文
摘要:001、 [root@PC1 test3]# echo "Hello, my name is aming."|grep -P '(?<=Hello, ).*(?= aming.)' Hello, my name is aming. 002、 [root@PC1 test3]# ifconfig |
阅读全文
摘要:001、 -c 选项表示中断后继续下载,即支持断点续传。 002、 -t选项表示失败后尝试的次数。
阅读全文
摘要:001、 [root@pc1 test]# ls a.txt b.txt c.txt d.txt e.txt f.txt g.txt h.txt index.txt [root@pc1 test]# cat index.txt ## 查找的索引文件 a.txt b.txt x.txt y.txt c
阅读全文
摘要:date主要用于显示日期,若是不以加号作为开头,则表示要设定时间,而时间格式为 MMDDhhmm[[CC]YY][.ss],其中 MM 为月份,DD 为日,hh 为小时,mm 为分钟,CC 为年份前两位数字,YY 为年份后两位数字,ss 为秒数。 001、最基本的用法 [root@PC1 test2
阅读全文
摘要:001、 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt 01 aa 02 03 04 aa 05 06 07 bb 08 09 10 bb 11 12 13 aa 14 15 16 bb 17 18 19 cc 20 21 22 cc
阅读全文
摘要:001、Linux中sed命令b选项屏蔽指定的处理区域 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试数据 1 01 02 a 2 03 04 a 3 05 06 a 4 07 08 5 09 10 k 6 11 12 a 7
阅读全文
摘要:001、 移除后缀 [root@PC1 test2]# a="a.csv.map.txt" ## 测试变量文件名称 [root@PC1 test2]# echo $a a.csv.map.txt [root@PC1 test2]# echo ${a%.*} ## 移除后缀使用的符号是% a.csv.
阅读全文
摘要:001、简单测试 [root@PC1 test2]# ls [root@PC1 test2]# a="abc" ## 生成一个测试变量 [root@PC1 test2]# echo $a ## 输出变量方式1 abc [root@PC1 test2]# echo ${a} ## 输出变量方式2 ab
阅读全文

浙公网安备 33010602011771号