$ cat a.txt hello This line starts with T and finishes with e foo $ grep '^a.*e$' a.txt and thisfinishes with e