Question 5 — AZ-104 Practice Exam 14
Two different Bash wildcard patterns can be used to list both .jpg and .jpeg files. Which two accomplish this? (Select two answers)
ls *.jpg *.jpeg
ls .jpg
ls *.png
ls 000?.jpg
Correct answers
ls *.jpg *.jpeg
ls .jpg
Explanations
Correct:
ls *.jpg *.jpeg: Lists files ending in either .jpg or .jpeg.
ls .jpg: Uses * to match both .jpg and .jpeg.
Wrong:
ls *.png: Restricts results to .png files only.
ls 000?.jpg: Matches numbered .jpg files with a single character placeholder, not .jpeg.