$ perl -n -e '$count++ if /\bhello\b/; END { print $count }' text.out