Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can anyone please point to some good sample files that helps to learn grep. This is for academic use. It should be a large one so that students could understand its importance

share|improve this question
    
Perhaps /usr/share/dict –  Kevin Dec 7 '12 at 4:05
add comment

2 Answers

up vote 2 down vote accepted

The file /etc/services contains a list of known services. It is too long to read through, and it might be a good real world example of when to use grep.

linux@host$ cat /etc/services | grep 'http'

To demonstrate how to find out which port http uses, or

linux@host$ grep '80/tcp' /etc/services

To find out what service you can expect to find on port 80

share|improve this answer
add comment

You might want to use books from Project Gutenberg. They are in the public domain, are quite large (you can cat some books together if desired) and can be used to devise many real-world examples of grep.

Otherwise, Wikipedia gives a bunch of public domain resources which might be available in plain text format.

share|improve this answer
add comment

Your Answer

 
discard

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.