The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: grep problem
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-22-2005
asal_email2 asal_email2 is offline
Registered User
 

Join Date: Jun 2005
Posts: 6
grep problem

I know that grep will display the matched line, but how about if I want to get the matched characted, for example:

file.txt contains:
Hello 123 World
This is a56 letter34
56are you su345re ?
1000 yes I do

I want to list all instances of digits that appear e.g:
123
56
34
56
345
1000

do I have to use sed ?

Thanks !
Reply With Quote
Forum Sponsor