The asterisk (*) is used to replace multiple characters in a string. For example, the command ls d* would return all of the files that start with the letter d. The command ls *d* would return all of the files that have a d anywhere in the name. For that reason it is referred to as a wildcard character.

Note: The * can be used with any command, the ls command is merely used as an example.

Examples

In this example we will display all of the files in a directory and then modify the ls command to display only those files with the letter d in their name:

$ ls
Franklin Pig_Pen Snoopy Woodstock blankets blankets_6 chuck chuck_1 game genius marcy mud.puddles
sally

$ ls *d*

mud.puddles

Woodstock :
Hero Flight

$