摘要: 001、求每列的和 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 3 5 2 4 1 3 5 5 2 3 8 3 root@PC1:/home/test2# awk '{for(i = 1; i <= NF; i++) 阅读全文
posted @ 2022-06-20 18:02 小鲨鱼2018 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 001、求每列的和 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt ## 测试数据 3 5 2 4 1 3 5 5 2 3 8 3 root@PC1:/home/test2# for i in $(seq $(head - 阅读全文
posted @ 2022-06-20 17:46 小鲨鱼2018 阅读(643) 评论(0) 推荐(0) 编辑
摘要: 1、001 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 1 e d 3 w e root@PC1:/home/test2# awk '{if($0 != "") {i = 0} else {i++}} END {pri 阅读全文
posted @ 2022-06-20 14:57 小鲨鱼2018 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 001、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 3 w e 1 e d root@PC1:/home/test2# cat -A a.txt $ $ 3 w e$ $ 1 e d$ root@PC1:/home/ 阅读全文
posted @ 2022-06-20 11:55 小鲨鱼2018 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1、 root@PC1:/home/test3# ls a.txt root@PC1:/home/test3# cat a.txt 1 e d 2 a g 3 w e 4 d g 5 g j 6 e j 7 l m 8 i n root@PC1:/home/test3# a=3 ## 行号 3 ro 阅读全文
posted @ 2022-06-20 11:27 小鲨鱼2018 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 001、sed实现 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 1 e d 2 a g 3 w e 4 d g 5 g j 6 e j 7 l m 8 i n root@PC1:/home/test2# sed 'N; 阅读全文
posted @ 2022-06-20 10:15 小鲨鱼2018 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 1、1、3行互换 root@PC1:/home/test2# ls a.txt swap.sh root@PC1:/home/test2# cat a.txt 1 x c 2 s d 3 e t 4 d s 5 j u 6 n x root@PC1:/home/test2# cat swap.sh 阅读全文
posted @ 2022-06-20 10:07 小鲨鱼2018 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 1、001 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt Chr1 Chr11 Chr7 Chr8 Chr10 Chr2 Chr5 Chr3 root@PC1:/home/test2# sort a.txt ## 排序异 阅读全文
posted @ 2022-06-20 08:36 小鲨鱼2018 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 01、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt ddd 2 8 aa 1 87 name gender score ff 2 3 ss 1 23 root@PC1:/home/test2# sort -k 3 a. 阅读全文
posted @ 2022-06-20 08:25 小鲨鱼2018 阅读(90) 评论(0) 推荐(0) 编辑