dir_tree
Version:
Creates a Searchable, Sortable & Printable Tree For Stated Directory Path.
90 lines (67 loc) • 2.87 kB
Plain Text
------------------
-filter-files
------------------
use:
---
used to search for files whose paths match specified patterns.
usage:
-----
dtree dir_path -filter-files sub-command{1,4} [command]
dtree dir_path -ff sub-command{1,4} [command]
sub-command{1, 4} means the sub-command should appear at least once
& at most 4 times.
a sub-command is made up of two parts:
the first part is any one of the following 20 strings:
-idr -idr-i -idr-ig -idr-g -idr-gi
-edr -edr-i -edr-ig -edr-g -edr-gi
-ifr -ifr-i -ifr-ig -ifr-g -ifr-gi
-efr -efr-i -efr-ig -efr-g -efr-gi
& the second part is a relevant pattern-string.
idr stands for include directory regexp.
edr stands for exclude directory regexp.
ifr stands for include file regexp.
efr stands for exclude file regexp.
the extra 'i' is the ignore case flag of the regexp.
the extra 'g' is the global match flag of the regexp.
searching-logic:
---------------
a directory will be searched only if it's not excluded.
(its path isn't like edr)
an excluded directory will not be searched at all.
after that, if the dir is not included (path isn't like idr),
then its direct descendant files will be skipped.
though its direct descendant dirs will be considered for search.
whenever a compatible dir is found (path is idr-edr passed),
each of its direct descendant files is tested:
to be not excluded (path isn't like efr) and
to be included (path is like ifr).
if so then the file is considered a successful match.
note:
----
the patterns test the paths relative to the target dir.
e.g., for dirs A/B/C the path of C relative to A is B/C.
list of commands:
----------------
short-form
-dirs -d
-no-of-dirs -nod
-total-dirs -td
-no-of-total-dirs -notd
-files -f
-no-of-files -nof
-total-files -tf
-no-of-total-files -notf
-dirs-creation-order -dco
-fileless-tree -ft
-size -sz
-size-of-files -sof
-unread-paths -up
-no-of-unread-paths -noup
-total-unread-paths -tup
-no-of-total-unread-paths -notup
-filter-dirs -fd
-filter-files -ff
-stats -st
-dirs-having-files -dhf
to get helpful information about a command, execute:
dtree -h command