Lessons
06Match many files at once
0 of 7 tasks

Lesson 06 · about 12 min · 7 tasks

Match many files at once

Use wildcards to work with whole groups of files in a single command.

step 1 of 7

Any characters

Typing file names one by one gets old fast. A wildcard describes a whole group of names at once. The most useful is *, which matches any run of characters:

$ ls photos/*.png
photos/screenshot-1.png  photos/screenshot-2.png  photos/screenshot-3.png  photos/vacation.png

*.png means “anything that ends in .png”. report* would mean “anything that starts with report”.

Your turn, in the terminal

  • List only the .png files in photos
mapfolders appear as you explore
/ …
home/ …
you/◂ you are here
nowList only the .png files in photos
terminal
Practice terminal. Nothing you do here touches your real computer.
Type help to see what it understands.
you@terminal-mastery:~$