TREESCAN(1)
πΈ NAME πΈ
okay bestie, so treescan is a directory-tree-scanning little icon β it scans directory trees, lists dirs/files, does stat, syncs, and greps. the whole package deal π
β¨ SYNOPSIS β¨
treescan [OPTION...] [PATH...]
-q, --quiet do not print list of files/directories
-0, --print0 use null character instead of newline to separate names
-s, --stat call stat on every entry, to get stat data into cache
-d, --dirs only list dirs
-f, --files only list files
-p, --progress regularly print progress to stderr
--sync open/fsync/close every entry
-g, --grep=RE only list files that match the given perl RegEx
no cap, that's literally the whole vibe check up there βοΈ
π DESCRIPTION π
so treescan scans directories and everything inside them, recursively, like it's going through your entire camera roll. π¦
by default it lists all the files and directories (dirs get a trailing / btw, so you can tell them apart), but it can also optionally do a bunch of other things if you ask it nicely. β¨
and if you give it no paths at all? it just uses "." β the current directory. main character energy fr. π
π OPTIONS π
-q,--quietβ by defaulttreescanprints the full paths of every directory and file it finds. this one turns that printing off completely. obsessed, because it's what you want when you're runningtreescanpurely for the side effects β like pullingstatdata into memory. π§ β¨-0,--print0β instead of newlines, it drops a null character</> after every filename. lowkey essential when you're piping into other programs and you do NOT want quoting drama (GNU grep, xargs and friends all have options to deal with this, iykyk). π«Ά-s,--statβ normallytreescanuses heuristics to dodge moststatcalls, and that is literally what makes it so fast. this flag forces it tostatevery single file. π
and yes, this is only useful for the side effect of pulling stat data into the cache. if your disk cache is big enough, it'll be full of file meta data once treescan finishes, which can speed up whatever you run next considerably. a lot of the time you can just run treescan in parallel with other directory-scanning programs to make them faster. slay. π₯
-d,--dirsβ only lists directories, not file paths. perfect when you just want a quick list of directories and their subdirectories. π-f,--filesβ only lists files, not directories. chef's kiss when you wanna operate on every file in a hierarchy and the directories would only get in the way. π-p,--progressβ regularly prints some progress info to standard error. iconic for long-running tasks so you're not just staring at a frozen terminal wondering if it died. and since it goes to stderr, you can still pipetreescan's output into other programs like nothing happened. β--syncβ this one makes sure all the files/dirs in a tree get sync'ed to disk. for example it's useful after unpacking an archive, to make sure the files actually hit the disk before you delete the archive file itself. π-g,--grep=REβ applies a perl regular expression (see theperlremanpage, bestie) to all paths that would normally be printed, and only prints the matching ones. π
the regex uses an /s (single line) modifier by default, so newlines get matched by ".". periodt. π
π AUTHOR π
- Marc Lehmann
<schmorp@schmorp.de> http://home.schmorp.de/
okay that's the whole page, you're welcome π«Ά
and for the cute sign-off: this lil masterpiece is perl v5.42.0, dated 2025-07-25, and it lives under the TREESCAN(1) name. go forth and scan, bestie. ππ
π¦ where this page comes from
- fedora 43: treescan 4.81-6.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms