易错点辨析
- [awe]*表示匹配awe这三个字符出现一次或多次,[]中表示的是一个匹配集,即匹配的元素只能从awe三个元素中选择
sed
sed ‘s///g’ /g表示全局替代,如果不加只能替换每行第一个匹配的元素
diff
使用diff比较两个文件的不同,如下有第四行和第8行的文件不同
camper: /project$ diff --color kitty_ipsum_2.txt doggy_ipsum_2.txt
4c4
/> my head something feels fishy scratch at fleas, meow until
----
/< my head something feels fishy scratch at fleas, woof until
8c8
>lick paw wake up owner meow meowzer. eat a rug and hairs
----
<lick paw wake up owner woof woof. eat a rug and hairs