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.
Last edited by slakmagik; 02-26-2008 at 04:17 AM.
Reason: added explanations
|