sed command help
Hai.
My file has proxy-connection connection server-connection i try to print only the 2 line connection sed -n "connection" filename but print all the lines |
grep '^connection$' FILE
but, with sed: sed -n '/^connection$/p' FILE -- The slashes tell sed it's a regex. ^ and $ anchor the expression at the beginning and end of the line. The 'p' flag prints. The regex is the same in grep but it knows it's a regex and always prints only matching lines by default. |
Presuming no whitespace interference ...
|
Really good SED tutorial here:
http://www.grymoire.com/Unix/Sed.html Look at the part about addresses |
All times are GMT -5. The time now is 05:57 AM. |