Algumas formas de respostas são WRONG , embora funcionem como afirmam na maior parte do tempo.
grep ".jpg" #match string "jpg" anywhere in the filename with any character in front of it.
# jpg -- not match
# .jpg -- match
# mjpgsfdfd -- match
grep ".*.jpg" #basically the same thing as above
grep ".jpg$" #match anything that have at least 4 chars and end with "jpg"
# i_am_not_a_.dummy_jpg -- match
grep ".*.jpg$" #the same as above (basically)
Para ter o melhor resultado, tente estes:
grep "[.]jpg$" #anything that end with ".jpg"
grep "\.jpg$" #the same as above, use escape sequence instead