Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to extract data from large group of files based on a regular expression.

Is their an application, script, batch or terminal command to do this?

share|improve this question
up vote 2 down vote accepted

grep should be what you want. It is very powerful. You can search multiple files for a pattern and you can even select the matcher.

There are many many options so you should really look up its man page I've linked you to.

share|improve this answer
awk and sed are also very powerful tools for parsing text files. – Nick Pascucci Mar 27 '11 at 16:41
@codeMonk very true. You should post that as an answer. – Octavian Damiean Mar 27 '11 at 16:55
yes grep is very powerful!! But is there a way to output the found regexp? grep usually outputs the whole line + filename – MIH1406 Mar 31 '11 at 22:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.