sed 's/string1/string2/g'
# ile baslayanlari sil:
sed -e '/^#/d' dosya_adi
6 ile bitenleri sil:
sed -e '/6$/d' dosya_adi
2 uzunluklu satirlari sil:
sed -e '/^..$/d' dosya_adi
5 ile başlayanları bas:
sed -n "/^5/p" file
ilk satıırı sil:
sed -e '1d' /etc/services | more
Modify anystring1 to anystring2??????????????
sed 's/\(.*\)1/\12/g'
Remove comments and blank lines:??????????????
sed '/ *#/d; /^ *$/d'
Print 1000th line:
sed -n '1000{p;q}'
sed ':a; /\\$/N; s/\\\n//; ta' Concatenate lines with trailing \
sed 's/[ \t]*$//' Remove trailing spaces from lines
sed 's/\([`"$\]\)/\\\1/g' Escape shell metacharacters active within double quotes
seq 10 | sed "s/^/ /; s/ *\(.\{7,\}\)/\1/" Right align numbers
sed -n '10,20p;20q' Print lines 10 to 20
sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q' Extract title from HTML web page
sed -i 42d ~/.ssh/known_hosts Delete a particular line
Hiç yorum yok:
Yorum Gönder