🍺 BREW Explorer

← all formulae

libmagic

brew install libmagic v5.48 BSD-2-Clause-Darwin AND BSD-2-Clause AND LicenseRef-Homebrew-public-domain

C library and command-line tool that identifies file types by magic number bytes, not extension.

Why you might care

Widely used as a build/runtime dependency in tools that need to detect file types (browsers, archives, editors). Also useful standalone to probe unknown files. The `file` command is POSIX standard; libmagic is the portable C implementation powering it across Unix-like systems.

Categories

Alternatives

file libmagic (GNU) mimetype exiftool
8.6k
30-day installs · #394
18.2k
90-day · #559
59.5k
365-day · #595

Links

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "file",
    "libmagic (GNU)",
    "mimetype",
    "exiftool"
  ],
  "build_dependencies": [],
  "categories": [
    "library",
    "file-utility"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Implementation of the file(1) command",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:50+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "libmagic",
  "github_default_branch": null,
  "github_last_commit_at": null,
  "github_readme_excerpt": null,
  "github_repo": null,
  "github_stars": null,
  "github_topics": [],
  "homepage": "https://www.darwinsys.com/file/",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": "Fine Free File Command (and libmagic)",
  "installs_30d": 8578,
  "installs_365d": 59462,
  "installs_90d": 18228,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "BSD-2-Clause-Darwin AND BSD-2-Clause AND LicenseRef-Homebrew-public-domain",
  "llm_generated_at": "2026-06-20T23:44:36+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "libmagic",
  "oldnames": [],
  "one_liner": "C library and command-line tool that identifies file types by magic number bytes, not extension.",
  "optional_dependencies": [],
  "rank_30d": 394,
  "rank_365d": 595,
  "rank_90d": 559,
  "raw_hash": "7e4de9cc5fbc6d78",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/lib/libmagic.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "pkgconf"
  ],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "5.48",
  "versioned_formulae": [],
  "why_use_this": "Widely used as a build/runtime dependency in tools that need to detect file types (browsers, archives, editors). Also useful standalone to probe unknown files. The `file` command is POSIX standard; libmagic is the portable C implementation powering it across Unix-like systems."
}