随笔分类 -  linux shell

上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 78 下一页
摘要:001、 方法1 [root@pc1 test01]# ls a.txt test.sh [root@pc1 test01]# cat a.txt ## 测试数据, 依据最后一列展开为多行 chrY 2657879 2658063 CTCF 652 GM19239 chrY 2664424 2664 阅读全文
posted @ 2023-09-12 22:14 小鲨鱼2018 阅读(37) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试数据 01 02 03 04 05 06 07 08 09 10 ## 获取数组的长度 [root@pc1 test02]# awk 'BEGIN{ay["a"] = 阅读全文
posted @ 2023-09-12 21:58 小鲨鱼2018 阅读(429) 评论(0) 推荐(0)
摘要:001、方法1 [root@pc1 test03]# ls a.txt [root@pc1 test03]# 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 阅读全文
posted @ 2023-09-12 17:55 小鲨鱼2018 阅读(266) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test03]# ls a.txt [root@pc1 test03]# 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 阅读全文
posted @ 2023-09-12 17:29 小鲨鱼2018 阅读(146) 评论(0) 推荐(0)
摘要:001、find >>> str1 = "xyabmnabkj" ## 测试字符串 >>> for i in enumerate(str1): ... print(i) ## 列出每个字符的索引 ... (0, 'x') (1, 'y') (2, 'a') (3, 'b') (4, 'm') (5, 阅读全文
posted @ 2023-09-11 23:26 小鲨鱼2018 阅读(88) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test01]# ls ## 测试文件 a.txt test01 test02 test03 [root@pc1 test01]# find ./ -type f -exec ls -l {} \; ## 列出文件大小 -rw-r--r--. 1 root root 2 阅读全文
posted @ 2023-09-11 11:18 小鲨鱼2018 阅读(140) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test01]# cat a.txt A:10 B:5 C:12 [root@pc1 test01]# cat b.txt 100 A 50 B 88 K 99 Y 42 C [root@pc1 test01]# awk '{if(NR == FNR) {ay[$1] 阅读全文
posted @ 2023-09-08 13:48 小鲨鱼2018 阅读(277) 评论(0) 推荐(0)
摘要:001、 正确做法 [root@pc1 test01]# ls a.txt b.txt [root@pc1 test01]# cat a.txt A:10 B:5 C:12 [root@pc1 test01]# cat b.txt 100 A 50 B 42 C [root@pc1 test01]# 阅读全文
posted @ 2023-09-08 13:25 小鲨鱼2018 阅读(257) 评论(0) 推荐(0)
摘要:001、 方法1 [root@pc1 test01]# ls a.txt b.txt [root@pc1 test01]# cat a.txt A:10 B:5 C:12 [root@pc1 test01]# cat b.txt 100 A 50 B 42 C [root@pc1 test01]# 阅读全文
posted @ 2023-09-08 12:44 小鲨鱼2018 阅读(1531) 评论(0) 推荐(0)
摘要:001、 -F 指定 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt a:b:c 3:8:k f:6:3 [root@pc1 test01]# awk -F ":" '{print $1}' a.txt a 3 f 002、-v FS 阅读全文
posted @ 2023-09-08 12:28 小鲨鱼2018 阅读(123) 评论(0) 推荐(0)
摘要:001、去重复保持原来的顺序 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 1 2 5 5 3 3 7 7 4 [root@pc1 test01]# awk 'ay[$0]++' a.txt ## 输出重复项,且保持 阅读全文
posted @ 2023-09-07 22:59 小鲨鱼2018 阅读(70) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test02]# ls a.txt test.sh [root@pc1 test02]# cat a.txt ## 测试序列 GATATATGCATATACTT [root@pc1 test02]# cat test.sh ## 计算程序 #!/bin/bash len 阅读全文
posted @ 2023-09-07 10:24 小鲨鱼2018 阅读(23) 评论(0) 推荐(0)
摘要:001、configure: error: libcurl library not found 002、解决方法 [root@pc1 test01]# yum -y install libcurl-devel 。 阅读全文
posted @ 2023-08-29 21:15 小鲨鱼2018 阅读(728) 评论(0) 推荐(0)
摘要:001、configure: error: liblzma development files not found 002、解决方法 [root@pc1 test01]# yum -y install xz-devel 。 阅读全文
posted @ 2023-08-29 21:10 小鲨鱼2018 阅读(388) 评论(0) 推荐(0)
摘要:001、configure: error: libbzip2 development files not found 002、解决方法 [root@pc1 test01]# yum -y install bzip2-devel 。 阅读全文
posted @ 2023-08-29 21:07 小鲨鱼2018 阅读(284) 评论(0) 推荐(0)
摘要:001、configure: error: zlib development files not found 002、解决方法: [root@pc1 test01]# yum -y install zlib-devel 。 阅读全文
posted @ 2023-08-29 21:04 小鲨鱼2018 阅读(167) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt b.txt [root@PC1 test02]# cat a.txt ## 测试数据 77 jj jj ee ww [root@PC1 test02]# cat b.txt ## 测试数据 xx rr ee 88 ww [root@P 阅读全文
posted @ 2023-08-17 22:02 小鲨鱼2018 阅读(121) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt b.txt [root@PC1 test02]# cat a.txt ## 测试文件 88 77 jj ff yy rr tt [root@PC1 test02]# cat b.txt ## 测试文件 uu rr tt uu 77 8 阅读全文
posted @ 2023-08-17 21:51 小鲨鱼2018 阅读(411) 评论(0) 推荐(0)
摘要:001、for循环 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 9 10 11 12 [root@PC1 test02]# awk '{sum = 0; for(i = 1; i < 阅读全文
posted @ 2023-08-17 18:08 小鲨鱼2018 阅读(269) 评论(0) 推荐(0)
摘要:001、FIELDWIDTHS 用于指定输出字段的宽度 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ [ro 阅读全文
posted @ 2023-08-17 17:42 小鲨鱼2018 阅读(106) 评论(0) 推荐(0)

上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 78 下一页