I have directory tree like:
dir11/dir21/dir31......./dirn1
dir12/dir22/dir32......./dirn2
dir13/dir23/dir33......./dirn3
Depths are different. Does it possible find all paths on which exists directory with file x.txt that has length>0 ? May be need use bash script? Thanks.
Open Windows Explorer. Select Organize / Folder and Search options. Select the Search Tab. In the How to search section, select the Include subfolders in search results when searching in file folders option.
Substitute dir /A:D. /B /S > FolderList. txt to produce a list of all folders and all subfolders of the directory. WARNING: This can take a while if you have a large directory.
A folder stored within another folder. Technically, the nested folder is a "subfolder," and subfolders can also contain subfolders and so on up to a maximum level. After three or four levels, it becomes cumbersome for users to deal with. See folder, files vs. folders and Win Folder organization.
I believe GNU find can match all your criteria by itself:
$ find /top/dir -not -empty -type f -name x.txt -printf '%h\n'
The above recursively searches /top/dir
for non-empty (-not -empty
), regular (-type f
) files named x.txt
, and prints the directories leading to these files (-printf '%h\n'
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With