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