Linux: Regular Expressions
file name is studentsyslog.txt
Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided.
As per requirement we need to filer the file so that output displays only the lines which contain the word CUPS in given file.
Here is there is no position of word mentioned like Sarting with , ending with..
Let us assume our present working directory is same as file exists. So the command is :
grep 'CUPS' studentsyslog.txt
If PWD is not as directory which file exists,
grep 'CUPS' /path/studentsyslog.txt
Get Answers For Free
Most questions answered within 1 hours.