Write a command to print the lines which end with the word “end”?

grep ‘end$’ filename
The ‘$’ symbol specifies the grep command to search for the pattern at the end of the line.

Category: UNIX Interview Questions.