上一页 1 ··· 151 152 153 154 155 156 157 158 159 ··· 408 下一页
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 7 yy 2 gg 4 mm 6 kk 5 mm 3 aa 9 xx 1 uu 8 oo [root@PC1 test]# cp a.txt a.txt_bak ## 阅读全文
posted @ 2022-12-16 19:53 小鲨鱼2018 阅读(985) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 1 2 3 4 5 6 7 8 9 10 [root@PC1 test]# head -n -3 a.txt ## 删除最后3行 1 2 3 4 5 6 7 002、 [root@PC 阅读全文
posted @ 2022-12-08 23:41 小鲨鱼2018 阅读(1478) 评论(0) 推荐(0)
摘要: 001、cat + wc -l [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试文件 1 2 3 4 5 6 7 8 9 10 [root@PC1 test]# cat a.txt | wc -l ## 输出文件的行数 10 002 阅读全文
posted @ 2022-12-08 23:34 小鲨鱼2018 阅读(289) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls [root@PC1 test]# mkdir test1 test2 ## 测试文件夹 [root@PC1 test]# echo "xxx" > test2/a.txt [root@PC1 test]# ls test1 test2 [root@P 阅读全文
posted @ 2022-12-08 23:17 小鲨鱼2018 阅读(933) 评论(0) 推荐(0)
摘要: 001、 -a 表示而且 [root@PC1 test]# a=5 [root@PC1 test]# b=10 [root@PC1 test]# if [ $a -gt 0 -a $b -gt 0 ]; then echo "yes"; fi ## -a表示逻辑而且,只有两边同时满足时才返回真 ye 阅读全文
posted @ 2022-12-08 23:08 小鲨鱼2018 阅读(759) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# a=10 [root@PC1 test]# echo $a 10 [root@PC1 test]# echo $b [root@PC1 test]# [ -z $a ] ## 如果变量没有被赋值,则返回真,否则返回假 [root@PC1 test]# ec 阅读全文
posted @ 2022-12-08 22:43 小鲨鱼2018 阅读(255) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls [root@PC1 test]# touch a.txt ## 测试文件 [root@PC1 test]# seq 6 > b.txt ## 测试文件 [root@PC1 test]# cat a.txt [root@PC1 test]# cat b 阅读全文
posted @ 2022-12-08 22:35 小鲨鱼2018 阅读(1169) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 a bc k bc e bc bc bc 3 44 55 60 bc bc kk uu [root@PC1 test]# rev a.txt | sed 's/cb/Q 阅读全文
posted @ 2022-12-08 20:28 小鲨鱼2018 阅读(366) 评论(0) 推荐(0)
摘要: 001、 删除匹配字符之后的若干行 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 9 10 [root@PC1 test]# sed '/5/,+1{/5/b;d}' a.txt ## 删除匹 阅读全文
posted @ 2022-12-08 20:02 小鲨鱼2018 阅读(1864) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 [root@PC1 test]# sed '/4/{n;d}' a.txt ## 删除匹配4的下一行 1 2 3 4 6 7 8 002 阅读全文
posted @ 2022-12-08 12:52 小鲨鱼2018 阅读(194) 评论(0) 推荐(0)
上一页 1 ··· 151 152 153 154 155 156 157 158 159 ··· 408 下一页