上一页 1 ··· 323 324 325 326 327 328 329 330 331 ··· 367 下一页
摘要: 1、awk命令 [root@PC3 test]# cat a.txt dfs dsafd d fgasdf safd ge [root@PC3 test]# awk -F "" '{print NF}' a.txt 3 5 1 6 4 2 2、 [root@PC3 test]# cat a.txt 阅读全文
posted @ 2021-01-30 11:57 小鲨鱼2018 阅读(6635) 评论(0) 推荐(0) 编辑
摘要: 1、 [root@PC3 sheep]# ls a.ped result.map result.ped tr.map [root@PC3 sheep]# ls -S | xargs -n 1 du -sh ## 从大致小进行排序 829M result.ped 204M a.ped 20M resu 阅读全文
posted @ 2021-01-30 11:45 小鲨鱼2018 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat a.txt 34 rtd 78 98 fgg 345 23 fgg 668 45 dfs 23 10 fsd 35 77 jla 35 87 saf 45 53 sfg 2334 46 wrt 098 2、awk命令显示特定列 [root@PC 阅读全文
posted @ 2021-01-29 22:34 小鲨鱼2018 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat a.txt 1 e abc 2 f a 3 x g 4 w p 5 q k 6 w f 7 x F 8 m y 9 c t 2、匹配特定字符串 [root@PC3 test]# cat a.txt 1 e abc 2 f a 3 x g 4 w 阅读全文
posted @ 2021-01-29 20:45 小鲨鱼2018 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat a.txt 1234567849 1234567849 1234567849 1234567849 2、删除前几个字符 [root@PC3 test]# sed 's/..//' a.txt ## 删除前两个字符 34567849 345678 阅读全文
posted @ 2021-01-29 20:03 小鲨鱼2018 阅读(19592) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat a.txt Beijing 2003 Beijing 2004 Beijing 2005 Beijing 2006 Beijing 2005 Beijing 2008 [root@PC3 test]# cat c.txt 1 2 3 4 5 6 阅读全文
posted @ 2021-01-29 13:51 小鲨鱼2018 阅读(605) 评论(0) 推荐(0) 编辑
摘要: 1、 [root@PC3 test]# cat c.txt 1 2 3 4 5 6 7 8 9 10 2、将2替换为xxxx,将5替换为yyyy,将7替换为zzz,删除匹配9的行,在第一行前增加first [root@PC3 test]# sed 's/2/xxxx/; s/5/yyyy/; s/7 阅读全文
posted @ 2021-01-29 13:41 小鲨鱼2018 阅读(147) 评论(0) 推荐(1) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat c.txt 1 2 3 4 5 6 7 8 9 10 2、提取包含2的行,其后1行,其后2行 [root@PC3 test]# sed -n '/2/p' c.txt 2 [root@PC3 test]# sed -n '/2/,+1p' c. 阅读全文
posted @ 2021-01-29 13:31 小鲨鱼2018 阅读(3759) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat b.txt e t 3 d g 2 k 8 p m 9 p 5 7 8 m i o e t d 2、awk加行号 [root@PC3 test]# awk '{print NR,$p}' b.txt 1 e t 3 2 d g 2 3 k 8 阅读全文
posted @ 2021-01-29 12:19 小鲨鱼2018 阅读(1206) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 [root@PC3 test]# cat b.txt e t 3 d g 2 k 8 p m 9 p 5 7 8 m i o e t d 2、删除包含m的行 [root@PC3 test]# sed '/m/d' b.txt e t 3 d g 2 k 8 p 5 7 8 e t d 阅读全文
posted @ 2021-01-29 12:13 小鲨鱼2018 阅读(2261) 评论(0) 推荐(0) 编辑
上一页 1 ··· 323 324 325 326 327 328 329 330 331 ··· 367 下一页