摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt h d w q g d t [root@PC1 test]# sed -n "$a,$b"p a.txt ## 同时传入两个变量参数 d w q 阅读全文
posted @ 2022-09-26 12:11 小鲨鱼2018 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@PC1 test]# ls 10.txt 1.txt 4.txt 7.txt a.txt [root@PC1 test]# rm -f {0..9}* ## 删除当前目录中所有以数字开头的文件 [root@PC1 test]# ls a.txt 阅读全文
posted @ 2022-09-26 11:40 小鲨鱼2018 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 在文件的行首添加一行。 001、 echo 实现 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试文件 a b c [root@PC1 test2]# echo "xxx" | cat - a.txt ## echo实现 xxx 阅读全文
posted @ 2022-09-26 11:06 小鲨鱼2018 阅读(6194) 评论(0) 推荐(0) 编辑