DEV Community

Amr Azzam
Amr Azzam

Posted on

๐——๐—ถ๐—ณ๐—ณ๐—ฒ๐—ฟ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—ฏ๐—ฒ๐˜๐˜„๐—ฒ๐—ฒ๐—ป * ๐—ฎ๐—ป๐—ฑ ** ๐—ถ๐—ป ๐—ณ๐—ถ๐—น๐—ฒ ๐—ฝ๐—ฎ๐˜๐—ต๐˜€?

Single and Double Asterisks are both wildcard characters, but they have different meanings:
(Single Asterisk):
The * character matches zero or more characters within a single directory name or filename.
It's typically used to match multiple files or directories based on a specific pattern within a single directory level.
For example, file*.txt would match file1.txt, file2.txt, etc., within the same directory.

** (Double Asterisks):
The ** character, often used in glob patterns, matches zero or more directories and files, recursively.
It's typically used to match files or directories across multiple directory levels.
For example, root/*/.txt would match all text files in any subdirectory of root, regardless of how deep they are nested.

In summary, * matches within a single directory level, while ** matches recursively across multiple directory levels.

Top comments (0)