Match any pathname with GLOB

Here's how to match path names with GLOB

Glob is an old Unix Program that's now built into the Unix Shell. Glob can be used for cleaning out directories of unwanted files or restricting a regular expression search to certain filenames.

Wildcard Matching

A string is a wildcard pattern if it contains one of the characters ‘?’, ‘*’ or ‘[’.

Match any single character with: ?
Match any string (including empty) with: *

So to list all your php files:

ls *.php

See also:
Glob man pages
ls Man pages
Php's Glob Manual
Cygwin for Windows users who want a Unix Style Shell Environment:


Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options