Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
Linux in General => Linux Development & Programming => Topic started by: ziox on January 04, 2005, 12:33:58 AM
-
HellO...
how can i grep a specific string ???
i want to grep something like this <whatIwant> i want this only So
i tried
grep -o "\<*\>" file > tofile Didn't work
grep -o "<*>" file > tofile Didn't work also
i want to grep just words between this '<' and this '>' symbols
grep,sed or awk all any ...
-
This may help you get closer to what you are looking for:
grep "<.*>" file > tofile
If you want to remove the "<>" from the output, check out the command cut.
Hope this helps!
-
why are you adding '<' and '>' you do not need them for grep to work
just say
grep string file
and you are done
use ' ' to enclose strings if their is space in between them