help on file extraction

Hello,

Im trying to extract a portion of a big file.
Using unique pattern /occurrence ,
(ex. loginname1,logoff and loginname2,logoff ),
I like to print the lines that contain the patterns and the lines between them.
Also, create a file for every login occurrence.

Thanks for everyone's help. Good day.

egrep -e PATTERN logfile > file

Where PATTERN is a regular expression that extracts the lines you want; logfile is the logfile, of course; and file is the same of the particular file for the user in the pattern.

All you have to do now is get a book on regular expresions and work on the syntax :slight_smile: