摘要: \反斜线,转义特殊字符 $ cat data2 The cost is $4.00 $ sed -n '/\$/p' data2 The cost is $4.00 锚字符 ^匹配行首 $ cat data3 This is a test line. this is another test line. A line that tests this feature. Yet more testin 阅读全文
posted @ 2020-01-03 16:08 LaniLai 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 替换字符,正斜线(/) 2 sed 's!/bin/bash/!/bin/csh/!' /etc/passwd 3 ying:x:1000:1000::/home/ying:/bin/bash 4 laiying:x:1001:1002::/home/laiying:/bin/bash 1 替换指定行的文本 2 cat data1.txt 3 替换第2行的字符 4 sed '2s/dog/ca 阅读全文
posted @ 2020-01-03 09:16 LaniLai 阅读(136) 评论(0) 推荐(0) 编辑