Linux Scripting – You have a text file called demo containing the following lines…


You have a text file called demo containing the following lines of text in a Linux system.

1. This is the first line of an experiment.

2. It is a text with experiment.

3. Lots of errors are present.

4. So much errors, all these errors are making me sick.

5. This is a line not containing any errors.

6. This is the last line of my experiment.

Now, you are asked to find all the lines containing the search pattern ‘experiment’ and print the lines matching the pattern in the shell. Which of these shell commands can you use for doing so?

Related Posts

Close Bitnami banner
Bitnami