The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
how to grep for a word and display only the word
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Rules & FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
how to grep for a word and display only the word
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
11-30-2006
vino
Supporter (in vino veritas)
Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Or you could use sed to get a grep -o effect.
Code:
sed -n -e "s/.*\(search string\).*/\1/p" input.txt
vino
View Public Profile
Find all posts by vino