watchman(1)
π watchman β the file watching service, bestie edition π
okay so you're here for watchman(1), the manual page for watchman, which is literally a file watching service. sit down, grab a boba, we're doing this π§β¨
β¨ NAME β¨
watchman β a file watching service. that's it, that's the name, she's simple and she's iconic π
πΈ SYNOPSIS πΈ
watchman [--OPTION ...] COMMAND
yeah that's the whole shape of it β options, then a command, periodt.
π¦ DESCRIPTION π¦
so watchman can recursively watch one or more directory trees β we also call those roots, iykyk.
and listen, this part matters: Watchman does not follow symlinks. she knows they exist, bestie, but they show up the same as any other file in its reporting. and she will wait for a root to settle down before she'll start triggering notifications or running commands. patience is a virtue π
Watchman is conservative, preferring to err on the side of caution β she considers files to be freshly changed when you start to watch them, or when she's unsure. no cap, she'd rather over-report than miss a thing.
you can query a root for file changes since you last checked, or for the current state of the tree. and β this is the good part β Watchman lets you subscribe to file changes that occur in a root. obsessed. π«Ά
π USAGE π
here's the vibe. this example establishes a watch on a source directory, then sets up a trigger named buildme that will run a tool named minify-css whenever a CSS file is changed. the tool gets passed a list of the changed filenames. iconic behaviour fr fr.
watchman watch ~/src
and the single quotes around '*.css' are important, do not skip them:
watchman -- trigger ~/src buildme '*.css' -- minify-css
the output for buildme will land in the Watchman log file unless you send it somewhere else. To use
(no bestie, that last sentence just ends there in the original. she said what she said. π)
π OPTIONS π
-h,--helpβ show this help π₯°--inetdβ spawning from an inetd style supervisor-v,--versionβ show version number-U,--sockname=PATHβ specify alternate sockname-o,--logfile=PATHβ specify path to logfile--log-levelβ set the log level (0= off, default is1, verbose =2) π--pidfile=PATHβ specify path to pidfile-p,--persistentβ persist and wait for further responses π-n,--no-save-stateβ don't save state between invocations--statefile=PATHβ specify path to file to hold watch and trigger state-j,--json-commandβ instead of parsing CLI arguments, take a single json object from stdin--output-encoding=ARGβ CLI output encoding.json(default) orbser--server-encoding=ARGβ CLI<->server encoding.bser(default) orjson-f,--foregroundβ run the service in the foreground--no-prettyβ don't pretty print JSON--no-spawnβ don't try to start the service if it is not available--no-localβ when no-spawn is enabled, don't try to handle request in client mode if service is unavailable
π AVAILABLE COMMANDS π
the full roster, no skips, main character energy only:
clockdebug-ageoutdebug-contenthashdebug-drop-privsdebug-get-subscriptionsdebug-poisondebug-recrawldebug-set-subscriptions-pauseddebug-show-cursorsfindflush-subscriptionsget-configget-pidget-socknamelist-capabilitiesloglog-levelqueryshutdown-serversincestate-enterstate-leavesubscribetriggertrigger-deltrigger-listunsubscribeversionwatchwatch-delwatch-del-allwatch-listwatch-project
π SEE ALSO π
for more information, please refer the online documentation π₯
and that's the whole page, bestie π this one's from the Linux corner of the world, dated 8 Oct 2019, and it's the watchman(1) page β mwah, slay, go watch some files πβ¨π¦
π¦ where this page comes from
- debian bookworm: watchman 4.9.0-7+b2 Β· Apache-2.0
- ubuntu jammy: watchman 4.9.0-6build2 Β· Apache-2.0
- ubuntu noble: watchman 4.9.0-7build4 Β· Apache-2.0
- ubuntu questing: watchman 4.9.0-9
- ubuntu resolute: watchman 4.9.0-9build3 Β· Apache-2.0
- ubuntu stonking: watchman 4.9.0-9build4 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms