1 | $ sed -e 's/foo/bar/' myfile.txt |
1 | $ sed -e 's/foo/bar/g' myfile.txt |
1 | $ sed -e '1,10s/enchantment/entrapment/g' myfile2.txt |
1 | $ sed -e '/^$/,/^END/s/hills/mountains/g' myfile3.txt |
1 | $ sed -e 's:/usr/local:/usr:g' mylist.txt |
1 | $ sed -e 's/<.*>//g' myfile.html |
1 | <b>This</b> is what <b>I</b> meant. |
1 | meant. |
1 | This is what I meant. |
1 | $ sed -e 's/<[^>]*>//g' myfile.html |
1 | '[a-x]*' |
1 | $ sed -e 's/.*/ralph said: &/' origmsg.txt |
1 2 | ralph said: Hiya Jim, ralph said: ralph said: I sure like this sed stuff! ralph said: |
1 | foo bar oni eeny meeny miny larry curly moe jimmy the weasel |
1 | '.* .* .*' |
1 | '\(.*\) \(.*\) \(.*\)' |
1 | $ sed -e 's/\(.*\) \(.*\) \(.*\)/Victor \1-\2 Von \3/' myfile.txt |
1 2 | Victor foo-bar Von oni Victor eeny-meeny Von miny Victor larry-curly Von moe Victor jimmy-the Von weasel |
1 | $ sed -n -e '=;p' myfile.txt |
1 | $ sed -n -e '=' -e 'p' myfile.txt |
1 | $ sed -n -f mycommands.sed myfile.txt |
1 | 1,20{ s/[Ll]inux/GNU\/Linux/g s/samba/Samba/g s/posix/POSIX/g } |
1 2 | 1,/^END/{ s/[Ll]inux/GNU\/Linux/g s/samba/Samba/g s/posix/POSIX/g p } |
1 | i\ This line will be inserted before each line |
1 2 3 4 | This line will be inserted before each line line 1 here This line will be inserted before each line line 2 here This line will be inserted before each line line 3 here This line will be inserted before each line line 4 here |
1 | i\ insert this line\ and this one\ and this one\ and, uh, this one too. |
1 | a\ insert this line after each line. Thanks! |
1 | c\ You're history, original line! Muhahaha! |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |