RWC(1)
π¦ RWC(1) β the rwc girlie's manual page π¦
okay so bestie, welcome to the General Commands Manual entry for rwc. she's small, she's iconic, she watches your files and tells you the second something changes. let's get into it π
β¨ NAME β¨
rwc β report when changed. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
rwc [-0cdep] [path ...]
β¨ DESCRIPTION β¨
so here's the tea π« β rwc takes a list of files or directories, watches them using inotify(7), and prints each file name as an absolute path the moment it changed. literally that simple, no cap.
if path is a single dash (-) or just... absent? she reads file names from the standard input instead. main character energy tbqh π
and listen β watching a directory will result in watching all changes to files which resides directly in that directory. directly, bestie. we do not do recursion here (more on that in the caveats, stay tuned π).
π the options are as follows π
-0β read input filenames seperated by NUL bytes, and likewise output filenames seperated by NUL bytes. NUL in, NUL out. symmetrical queen π-cβ detect all file creations, includingopen(2)withO_CREAT,mkdir(2),link(2),symlink(2), andbind(2). created files get prefixed by+(that is, a plus and a space). β οΈ heads up: this option has the side-effect of printing files twice that are created and immediately changed after. not a bug, just her being thorough π«Ά-dβ also detect file deletion. deleted files get prefixed by-(that is, a dash and a space). gone but not forgotten π₯²-eβ exit after the first reported change. one and done, she's out βοΈ-pβ pipe mode; don't report changes while the standard output pipe is not empty. use this to piperwcto programs which read standard input slowly. she waits her turn, politely π
β¨ EXIT STATUS β¨
the rwc utility exits 0 on success, and >0 if an error occurs. slay when it works, sad little number when it doesn't π
β¨ EXAMPLES β¨
watch all source files and run make(1) when something changes:
% git ls-files | rwc -p | xe -v -s make
make a sound when a download is done (the little bing that lives in my head rent free fr fr):
% rwc ~/Downloads | xe -s 'mpv ~/.sounds/bing.wav'
β¨ SEE ALSO β¨
entr(1), inotifywatch(1), wendy(1) β go read those too, iykyk π¦
β¨ AUTHORS β¨
Leah Neukirchen <leah@vuxu.org> β the icon, the legend, the moment π
β¨ CAVEATS β¨
okay bestie, now the real talk, because we respect the limits π₯
rwc is limited by some restrictions of inotify(7). you can only watch files and directories you can read, and the amount of inotify descriptors is limited. and β say it with me β watching directories is not recursive. do not come for her about it π€
rwc only uses one watch descriptor per directory, and filters file names itself. this is actually a flex: it allows tracking files which get safely written by unlink(2) and rename(2), and also watching files which don't exist yet. future files! she sees them! β
many tools like to create temporary files in their working directory, which may distort the output. so if your output looks kinda chaotic... it's not her, it's them π
β¨ LICENSE β¨
rwc is in the public domain. π
to the extent possible under law, the creator of this work has waived all copyright and related or neighboring rights to this work.
http://creativecommons.org/publicdomain/zero/1.0/
and that's the whole page, bestie π this came to you from Debian, dated January 3, 2021 β the RWC(1) girlie herself, signing off. go watch some files π¦β¨π
π¦ where this page comes from
- nixos 26.05: rwc 0.3
- nixpkgs unstable: rwc 0.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms