1TREESCAN(1)           User Contributed Perl Documentation          TREESCAN(1)
2
3
4

NAME

6       treescan - scan directory trees, list dirs/files, stat, sync, grep
7

SYNOPSIS

9          treescan [OPTION...] [PATH...]
10
11             -q, --quiet    do not print list of files/directories
12             -0, --print0   use null character instead of newline to separate names
13             -s, --stat     call stat on every entry, to get stat data into cache
14             -d, --dirs     only list dirs
15             -f, --files    only list files
16             -p, --progress regularly print progress to stderr
17                 --sync     open/fsync/close every entry
18             -g, --grep=RE  only list files that match the given perl RegEx
19

DESCRIPTION

21       The treescan command scans directories and their contents recursively.
22       By default it lists all files and directories (with trailing "/"), but
23       it can optionally do various other things.
24
25       If no paths are given, treescan will use ".", the current directory.
26
27   OPTIONS
28       -q, --quiet
29           By default, treescan prints the full paths of all directories or
30           files it finds. This option disables printing of filenames
31           completely. This is useful if you want to run treescan solely for
32           its side effects, such as pulling "stat" data into memory.
33
34       -0, --print0
35           Instead of using newlines, use null characters after each filename.
36           This is useful to avoid quoting problems when piping the result
37           into other programs (for example, GNU grep, xargs and so on all
38           have options to deal with this).
39
40       -s, --stat
41           Normally, treescan will use heuristics to avoid most "stat" calls,
42           which is what makes it so fast. This option forces it to "stat"
43           every file.
44
45           This is only useful for the side effect of pulling the "stat" data
46           into the cache. If your disk cache is big enough, it will be filled
47           with file meta data after treescan is done, which can speed up
48           subsequent commands considerably. Often, you can run treescan in
49           parallel with other directory-scanning programs to speed them up.
50
51       -d, --dirs
52           Only lists directories, not file paths. This is useful if you
53           quickly want a list of directories and their subdirectories.
54
55       -f, --files
56           Only list files, not directories. This is useful if you want to
57           operate on all files in a hierarchy, and the directories would ony
58           get in the way.
59
60       -p, --progress
61           Regularly print some progress information to standard error. This
62           is useful to get some progress information on long running tasks.
63           Since the progress is printed to standard error, you can pipe the
64           output of treescan into other programs as usual.
65
66       --sync
67           The "--sync" option can be used to make sure all the files/dirs in
68           a tree are sync'ed to disk. For example this could be useful after
69           unpacking an archive, to make sure the files hit the disk before
70           deleting the archive file itself.
71
72       -g, --grep=RE
73           This applies a perl regular expression (see the perlre manpage) to
74           all paths that would normally be printed and will only print
75           matching paths.
76
77           The regular expression uses an "/s" (single line) modifier by
78           default, so newlines are matched by ".".
79

AUTHOR

81        Marc Lehmann <schmorp@schmorp.de>
82        http://home.schmorp.de/
83
84
85
86perl v5.38.0                      2023-07-20                       TREESCAN(1)
Impressum