Sed Command
sed OPTIONS... [SCRIPT] [INPUTFILE...] $cat > geekfile.txt
unix is great os. unix is opensource. unix is free os.
learn operating system.
unix linux which one you choose.
unix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.$sed 's/unix/linux/' geekfile.txtlinux is great os. unix is opensource. unix is free os. learn operating system. linux linux which one you choose. linux is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.$sed 's/unix/linux/2' geekfile.txtunix is great os. linux is opensource. unix is free os. learn operating system. unix linux which one you choose. unix is easy to learn.linux is a multiuser os.Learn unix .unix is a powerful.$sed 's/unix/linux/g' geekfile.txtlinux is great os. linux is opensource. linux is free os. learn operating system. linux linux which one you choose. linux is easy to learn.linux is a multiuser os.Learn linux .linux is a powerful.$sed 's/unix/linux/3g' geekfile.txtunix is great os. unix is opensource. linux is free os. learn operating system. unix linux which one you choose. unix is easy to learn.unix is a multiuser os.Learn linux .linux is a powerful.$ echo "Welcome To The Geek Stuff" | sed 's/\(\b[A-Z]\)/\(\1\)/g'(W)elcome (T)o (T)he (G)eek (S)tuff$sed '3 s/unix/linux/' geekfile.txtunix is great os. unix is opensource. unix is free os. learn operating system. linux linux which one you choose. unix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.$sed 's/unix/linux/p' geekfile.txtlinux is great os. unix is opensource. unix is free os. linux is great os. unix is opensource. unix is free os. learn operating system. linux linux which one you choose. linux linux which one you choose. linux is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful. linux is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.$sed -n 's/unix/linux/p' geekfile.txtlinux is great os. unix is opensource. unix is free os. linux linux which one you choose. linux is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.$sed '1,3 s/unix/linux/' geekfile.txtlinux is great os. unix is opensource. unix is free os. learn operating system. linux linux which one you choose. unix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.$sed '2,$ s/unix/linux/' geekfile.txtunix is great os. unix is opensource. unix is free os. learn operating system. linux linux which one you choose. linux is easy to learn.unix is a multiuser os.Learn unix .unix is a powerfulSyntax: $ sed 'nd' filename.txt Example: $ sed '5d' filename.txtSyntax: $ sed '$d' filename.txtSyntax: $ sed 'x,yd' filename.txt Example: $ sed '3,6d' filename.txtSyntax: $ sed 'nth,$d' filename.txt Example: $ sed '12,$d' filename.txtSyntax: $ sed '/pattern/d' filename.txt Example: $ sed '/abc/d' filename.txt
Last updated