TREESCAN(1)

πŸ“¦
version 4.81 Β· 3 versions
, in fedora 43

🌸 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 default treescan prints 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 running treescan purely for the side effects β€” like pulling stat data 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 β€” normally treescan uses heuristics to dodge most stat calls, and that is literally what makes it so fast. this flag forces it to stat every 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 pipe treescan'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 the perlre manpage, 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 πŸ‘‘


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