Consider the following file structure:
root
|- folder1
|- folder2
|- folderN
|- file1
|- file2
|- fileN
How to target only files without excluding (!
) each folder one by one?
Consider the following file structure:
root
|- folder1
|- folder2
|- folderN
|- file1
|- file2
|- fileN
How to target only files without excluding (!
) each folder one by one?
So you just want the files in that certain root directory, without the folders and contents of those folders.
The glob you are looking for is *
. This one selects all the files inside the directory you are currently. Or use root/*
if you want to select all the files inside the root
folder without its subfolders. To select subfolders and subfolder content, you have to use the Globstar: **
You can test your glob easily here: