# 使用 Homebrew, apt, dnf, MacPorts, Nix, zypper, winget 安装 fswatch

查看 fswatch 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:fswatch
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install fswatch
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install fswatch
```

  证据: MacPorts ports tree: sysutils/fswatch/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install fswatch
```

  证据: Debian stable package indexes: fswatch from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install fswatch
```

  证据: Fedora Rawhide package metadata: fswatch from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#fswatch
```

  证据: nixpkgs package indexes: pkgs/by-name/fs/fswatch/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install fswatch
```

  证据: openSUSE Tumbleweed package metadata: fswatch from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- winget (92%):

```sh
winget install --id emcrisostomo.fswatch -e
```

  证据: Windows Package Manager source index: emcrisostomo.fswatch from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:fswatch
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/fswatch>
- **版本:** 1.22.0
- **来源摘要:** Monitor a directory for changes and run a shell command
- **主页:** <https://emcrisostomo.github.io/fswatch/>
- **仓库:** <https://github.com/emcrisostomo/fswatch>
- **上游文档:** <https://emcrisostomo.github.io/fswatch/>
- **许可证:** GPL-3.0-or-later AND Apache-2.0
- **源码归档:** <https://github.com/emcrisostomo/fswatch/releases/download/1.22.0/fswatch-1.22.0.tar.gz>
- **最后更新:** 2026-07-22T12:18:56Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- fswatch (cli)
- fswatch (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.22.0
- 管理器更新时间: 2026-07-22
- 本地数据: OK
- 上游仓库: https://github.com/emcrisostomo/fswatch
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

fswatch is a cross-platform file-change monitor and libfswatch frontend with backends for macOS, BSD, Linux, Solaris/Illumos, Windows, and portable polling.

### 项目历史

The fswatch README traces the project to Alan Dipert's 2009 OS X implementation using Apple's FSEvents API. At the end of 2013 Enrico M. Crisostomo wrote fsw as a cross-platform replacement and front end for multiple filesystem event APIs.

In April 2014, the authors of fswatch and fsw agreed to merge the programs, with future development continuing in the fswatch repository under Crisostomo's maintenance. The current README describes fswatch as a frontend for libfswatch, with C, C++, and Go bindings noted.

### 采用历史

The official README tells users to obtain fswatch from their operating-system or third-party package manager when available, and gives examples for MacPorts, Homebrew, and FreeBSD pkg. The supplied package data shows packages across Homebrew, Debian, Fedora, MacPorts, Nix, Ubuntu, winget, and openSUSE families.

The project has continued as a packaged command-line utility while also exposing libfswatch for programs that need filesystem events without maintaining per-platform watcher code.

### 使用方式

fswatch accepts paths and streams events for changes to files or directories. Its output can be piped to shell loops or to xargs, and the -o mode supports running one command per batch of changes.

By default fswatch chooses the best available monitor for the platform, while users can select monitors explicitly. The README recommends FSEvents on macOS, File Events Notification on Solaris derivatives, inotify on Linux, the Windows monitor on Windows, kqueue for small BSD/macOS watch sets, and polling as the fallback.

### 为什么软件包爱好者会关心

fswatch is important to package users because it provides one CLI and one library abstraction over the incompatible filesystem notification APIs that build tools, static-site generators, test runners, and shell automation frequently need.

For maintainers, fswatch is also a classic portability package: it wraps native APIs where possible, keeps a poll fallback, publishes Texinfo/man/PDF/API documentation, and ships through many Unix and Windows package channels.

### 时间线

- 2009: First fswatch implementation written for OS X FSEvents.
- 2013: fsw written as a multi-backend replacement effort.
- 2014: fsw and fswatch merged, with development continuing in fswatch.
- 2024: fswatch 1.18.0 adopted C++17 and updated FSEvents/inotify rename-correlation support.
- 2026: fswatch 1.21.0 documented conjunctive filters, pruning, and CMake package configuration files for libfswatch.

### Related projects

- fsw is the predecessor project that merged into fswatch.
- libfswatch is the library layer behind the fswatch frontend.
- The project is related to native event systems including FSEvents, kqueue, File Events Notification, inotify, fanotify, ReadDirectoryChangesW, and stat-based polling.

### 来源

- <https://api.github.com/repos/emcrisostomo/fswatch>
- <https://emcrisostomo.github.io/fswatch/documentation.html>
- <https://github.com/emcrisostomo/fswatch>
- <https://raw.githubusercontent.com/emcrisostomo/fswatch/master/NEWS>
- <https://raw.githubusercontent.com/emcrisostomo/fswatch/master/README.md>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** fswatch
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Debian apt - fswatch - 1.14.0+repack-13.1+b1: normalized package name match | Debian stable package indexes: fswatch from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | file change monitor based on inotify | http://emcrisostomo.github.io/fswatch
- Nix - fswatch: normalized package name match | nixpkgs package indexes: pkgs/by-name/fs/fswatch/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - fswatch - 1.14.0+repack-13.1: normalized package name match | Ubuntu 24.04 LTS package indexes: fswatch from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | file change monitor based on inotify | http://emcrisostomo.github.io/fswatch
- dnf - fswatch - 1.17.1-7.fc45: normalized package name match | Fedora Rawhide package metadata: fswatch from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | A cross-platform file change monitor | https://github.com/emcrisostomo/fswatch
- dnf - fswatch-devel - 1.17.1-7.fc45: normalized package name match | Fedora Rawhide package metadata: fswatch-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Development files for fswatch | https://github.com/emcrisostomo/fswatch
- dnf - fswatch-static - 1.17.1-7.fc45: normalized package name match | Fedora Rawhide package metadata: fswatch-static from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Static library for fswatch | https://github.com/emcrisostomo/fswatch
- zypper - fswatch - 1.22.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: fswatch from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Multi platform file change monitor | https://github.com/emcrisostomo/fswatch
- zypper - fswatch-doc - 1.22.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: fswatch-doc from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Documentation for fswatch | https://github.com/emcrisostomo/fswatch
- zypper - fswatch-lang - 1.22.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: fswatch-lang from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Translations for package fswatch | https://github.com/emcrisostomo/fswatch
- zypper - libfswatch-devel - 1.22.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: libfswatch-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Development files for fswatch | https://github.com/emcrisostomo/fswatch
- zypper - libfswatch15 - 1.22.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: libfswatch15 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Shared library for fswatch | https://github.com/emcrisostomo/fswatch
- MacPorts - fswatch: normalized package name match | MacPorts ports tree: sysutils/fswatch/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- winget - emcrisostomo.fswatch: normalized package name match | Windows Package Manager source index: emcrisostomo.fswatch from https://cdn.winget.microsoft.com/cache/source.msix


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [gitwatch](https://pkg.so/zh-hans/brew/gitwatch/) - Popular package that depends on this formula.
- [watcher](https://pkg.so/zh-hans/brew/watcher/) - Shares pkgdb curated category or tags: cli, cross-platform, developer-tools, file-watcher.
- [fsw](https://pkg.so/zh-hans/brew/fsw/) - Shares pkgdb curated category or tags: cli, developer-tools, file-watcher, filesystem-events.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Shares pkgdb curated category or tags: cli, cross-platform, developer-tools.
- [watchman](https://pkg.so/zh-hans/brew/watchman/) - Shares pkgdb curated category or tags: cli, developer-tools, file-watcher.
- [meson](https://pkg.so/zh-hans/brew/meson/) - Shares pkgdb curated category or tags: cli, cross-platform, developer-tools.
- [apr](https://pkg.so/zh-hans/brew/apr/) - Shares pkgdb curated category or tags: cli, cross-platform, developer-tools.
- [qtbase](https://pkg.so/zh-hans/brew/qtbase/) - Shares pkgdb curated category or tags: cli, cross-platform, developer-tools.
- [qt](https://pkg.so/zh-hans/brew/qt/) - Shares pkgdb curated category or tags: cli, cross-platform, developer-tools.
- [hotbuild](https://pkg.so/zh-hans/brew/hotbuild/) - Local package facts share a topical domain. Shared terms: cli, cross, developer, developer-tools, file.

## Combined YAML source

View the package source record on GitHub. [combined/fswatch.yml](https://github.com/mxcl/pkgdb/blob/main/combined/fswatch.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
