Wildcard Unix Command

The * wildcard
The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example,

% ls list*




This will list all files in the current directory starting with list....

% ls *list


This will list all files in the current directory ending with ....list

The ? Wildcard

The character ? Will match exactly one character.
So ?ouse will match files like house and mouse, but not grouse.

% ls ?list


No comments:

Post a Comment