随笔分类 -  linux shell

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 78 下一页
摘要:001、asort函数 [root@PC1 test01]# ls a.txt [root@PC1 test01]# cat a.txt ggg 666 aaa 125 ddd 123 kkk 777 bbb 128 fff 999 ccc 120 [root@PC1 test01]# awk '{ 阅读全文
posted @ 2023-07-13 20:42 小鲨鱼2018 阅读(147) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test01]# ls test.txt [root@PC1 test01]# cat -A test.txt ## 存在特殊字符 M-cM-^@M-^@M-cM-^@M-^@ TomM-cM-^@M-^@M-cM-^@M-^@ 2012-12-11 car 53000 阅读全文
posted @ 2023-07-13 15:46 小鲨鱼2018 阅读(62) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test01]# ls a.txt [root@PC1 test01]# cat a.txt ## 测试数据 34gfjfgax gd;g3;54;66;77 sfdgfghcg ljhg9;875gf wr346dxzc mbkbczxdwa [root@PC1 te 阅读全文
posted @ 2023-07-13 08:39 小鲨鱼2018 阅读(297) 评论(0) 推荐(0)
摘要:substr命令用于截取字符串 001、 [root@PC1 test01]# ls a.txt [root@PC1 test01]# cat a.txt ## 测试数据 34gfjfgax gdg3546677 sfdgfghcg ljhg9875gf wr346dxzc mbkbczxdwa [ 阅读全文
posted @ 2023-07-13 08:20 小鲨鱼2018 阅读(454) 评论(0) 推荐(0)
摘要:001、 awk数组实现 [root@PC1 test01]# ls a.txt [root@PC1 test01]# cat a.txt ## 测试数据 ERR219543 Africa ERR219546 kkkk ERR229467 qqqq ERR229468 qqqq ERR229471 阅读全文
posted @ 2023-07-12 23:35 小鲨鱼2018 阅读(74) 评论(0) 推荐(0)
摘要:001、常规删除方法 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 ## str1 01 02 03 04 05 06 07 08 ## 09 10 11 12 13 14 15 16 17 18 19 20 ## 阅读全文
posted @ 2023-07-11 23:55 小鲨鱼2018 阅读(367) 评论(0) 推荐(0)
摘要:001、awk实现 [root@PC1 test02]# ls a.txt [root@PC1 test02]# 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 阅读全文
posted @ 2023-07-11 23:03 小鲨鱼2018 阅读(110) 评论(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]# sed ':a; N; s/\n/ /; ta' a.txt 阅读全文
posted @ 2023-07-11 21:13 小鲨鱼2018 阅读(184) 评论(0) 推荐(0)
摘要:ls -F 选项在输出项追加文件的类型标识符。 例如: 001、 [root@PC1 test02]# ls ## 测试文件 test test01.txt test02.txt test03.txt test04.txt xxx001.ped xxx003.ped test01.csv test0 阅读全文
posted @ 2023-07-11 17:52 小鲨鱼2018 阅读(198) 评论(0) 推荐(0)
摘要:break是跳出循环exit是退出脚本。 看下面的例子。 001、break [root@PC1 test02]# cat test.txt ## 测试数据 3 4 5 6 7 [root@PC1 test02]# cat test.sh ## 测试程序 #!/bin/bash for i in $ 阅读全文
posted @ 2023-07-10 15:45 小鲨鱼2018 阅读(140) 评论(0) 推荐(0)
摘要:001、 sed实现 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 01 02 05 06 x 09 10 44 66 33 77 13 14 17 18 k 21 22 88 99 25 26 21 22 x 25 阅读全文
posted @ 2023-07-07 11:11 小鲨鱼2018 阅读(137) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test03]# ls file.txt [root@PC1 test03]# cat file.txt ## 测试数据 match random text line 1 match match match random text line 2 match random 阅读全文
posted @ 2023-07-07 10:35 小鲨鱼2018 阅读(40) 评论(0) 推荐(0)
摘要:001、 (base) [b20223040323@admin2 test]$ ls a.txt (base) [b20223040323@admin2 test]$ cat a.txt ## 测试数据 gene exon exon exon exon gene exon exon gene exo 阅读全文
posted @ 2023-07-07 08:48 小鲨鱼2018 阅读(29) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 ID=gene-ABCC1 a 6121 ID=gene-ABCC1 b 6121 ID=gene-JFEE3 j 876 ID=gene-ABCC5 c 57 阅读全文
posted @ 2023-07-06 12:00 小鲨鱼2018 阅读(135) 评论(0) 推荐(0)
摘要:001、-s用于指定输出的间隔符 [root@PC1 test02]# seq 10 ## 默认输出分隔符为换行符 1 2 3 4 5 6 7 8 9 10 [root@PC1 test02]# seq -s " " 10 ## 指定空格为换行符 1 2 3 4 5 6 7 8 9 10 [root 阅读全文
posted @ 2023-07-05 21:45 小鲨鱼2018 阅读(553) 评论(0) 推荐(0)
摘要:001、创建数组 [root@PC1 test02]# ay=(1 2 3 4) ## 生成数组 [root@PC1 test02]# echo ${ay[*]} ## 输出数组 1 2 3 4 [root@PC1 test02]# echo ${#ay[*]} ## 输出数组的长度 4 002、 阅读全文
posted @ 2023-07-05 18:11 小鲨鱼2018 阅读(264) 评论(0) 推荐(0)
摘要:001、最大值和最小值 [root@PC1 test03]# ls a.txt [root@PC1 test03]# cat a.txt ## 测试数据 a 6 a 9 a 7 b 5 b 10 b 5 b 9 c 5 c 3 c 4 c 1 ## 根据第一列输出最大值 [root@PC1 test 阅读全文
posted @ 2023-07-05 08:33 小鲨鱼2018 阅读(254) 评论(0) 推荐(0)
摘要:001、 [root@PC1 test03]# ls a.txt b.txt [root@PC1 test03]# cat a.txt ## 测试数据连续递增 1 2 3 4 5 6 [root@PC1 test03]# cat b.txt ## 测试数据,非连续递增 1 2 3 5 6 [root 阅读全文
posted @ 2023-07-04 22:42 小鲨鱼2018 阅读(135) 评论(0) 推荐(0)
摘要:001、ls默认是按照文件名称顺序列出的 [root@PC1 test02]# ls ## 测试文件 a.txt b.txt c.txt [root@PC1 test02]# ls -l ## 默认按照文件名称顺序 total 125000 -rw-r--r--. 1 root root 15360 阅读全文
posted @ 2023-07-04 19:58 小鲨鱼2018 阅读(1053) 评论(0) 推荐(0)
摘要:001、测试数据 [root@PC1 test]# ls aa.txt [root@PC1 test]# cat aa.txt Qinghai Qinghai shandong Shanghai shanxi [root@PC1 test]# cat -A aa.txt Qinghai$ Qingh 阅读全文
posted @ 2023-07-01 21:02 小鲨鱼2018 阅读(180) 评论(0) 推荐(0)

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 78 下一页