Count export files selected by wildcards

A data-export directory contains exactly these eight regular files:

  • lab1.csv
  • lab2.csv
  • lab10.csv
  • labA.csv
  • lab.csv
  • lab1.csv.bak
  • .lab3.csv
  • lab-1.csv

A glob is a filename pattern interpreted by the shell. Use Bash's default filename-matching settings in the C locale. An initial wildcard does not match a leading period.


For each independent pattern below, enter the exact integer number of matching files.

  • Pattern A: lab?.csv
  • Pattern B: lab*.csv
  • Pattern C: lab[0-9].csv
  • Pattern D: *.csv
  • Pattern E: lab[!0-9].csv
PatternNumber of matching files
A
B
C
D
E

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Regular Expressions and Wild Cards Questions: