# 使用 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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
- **版本:** 1.22.0
- **来源摘要:** Monitor a directory for changes and run a shell command
- **主页:** <https://emcrisostomo.github.io/fswatch/>
- **仓库:** <https://github.com/emcrisostomo/fswatch>
- **最后更新:** 2026-07-22T12:18:56Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- fswatch (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.22.0
## 项目历史与用法

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

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

- 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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


## 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
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
