# 使用 Homebrew, MacPorts, Nix, apk, apt, dnf, scoop 安装 g-ls

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

## 安装

```sh
sudo av install brew:g-ls
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install g-ls
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install g-ls
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#g-ls
```

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

- apk (92%):

```sh
sudo apk add g++
```

  证据: Alpine Linux edge package indexes: g++ from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install g++
```

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

- dnf (92%):

```sh
sudo dnf install gcc-c++
```

  证据: Fedora Rawhide package metadata: gcc-c++ from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/g
```

  证据: Scoop official bucket manifest trees: bucket/g.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:g-ls
- **软件包管理器:** Homebrew
- **版本:** 0.31.2
- **来源摘要:** Powerful and cross-platform ls
- **主页:** <https://equationzhao.github.io/g/>
- **仓库:** <https://github.com/Equationzhao/g>
- **最后更新:** 2026-07-27T14:57:48+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- g (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

g is a Go-based, cross-platform `ls` alternative packaged in Homebrew as `g-ls` and installed as the `g` executable. The upstream README describes it as feature-rich and customizable, with icons, colors, multiple layouts, git status integration, fuzzy path matching, and hyperlink support.

### 项目历史

The repository was created in April 2023, and GitHub Releases show v0.2.1 published the same day. The README frames g as an enhanced directory lister rather than a file manager, adding visual layouts and metadata to the familiar `ls` role.

The project continued through frequent 0.x releases; by 2025 it had reached the 0.30 series, and the visible release feed shows v0.31.2 in 2026. The bundled manual documents a broad option surface for display formats, filtering, fuzzy indexing, shell initialization, sorting, and metadata columns.

### 采用历史

Official installation notes document Arch AUR, Homebrew, a Homebrew tap, MacPorts, Scoop, pre-built release artifacts, deb packages, install scripts, and `go install`. That spread follows the usual adoption route for Go CLIs: direct binary releases, Go module installation, and native package-manager recipes.

### 使用方式

Users run `g path(s)` as an `ls` replacement and enable options such as icons, long format, tree layout, JSON, markdown, CSV, git status, MIME and charset display, fuzzy path matching, and shell initialization scripts for Bash, Zsh, Fish, PowerShell, and Nushell.

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

g is interesting in the crowded modern-ls category because it combines exa/eza-style visual listing, lsd-style icons, git metadata, multiple machine-readable output formats, and shell integration in a single Go binary. For package maintainers, the main wrinkle is name collision: the package is `g-ls` in Homebrew while the executable is `g`.

### 时间线

- 2023: GitHub repository created.
- 2023: Release v0.2.1 published.
- 2025: Release v0.30.0 published.
- 2026: Release v0.31.2 published.

### Related projects

- The README says g is highly inspired by exa/eza, lsd, and ls-go. It also describes zoxide- and fzf-like fuzzy path matching, placing g near both modern `ls` replacements and shell-navigation helpers.

### 来源

- <https://api.github.com/repos/Equationzhao/g>
- <https://github.com/Equationzhao/g>
- <https://github.com/Equationzhao/g/releases>
- <https://raw.githubusercontent.com/Equationzhao/g/master/README.md>
- <https://raw.githubusercontent.com/Equationzhao/g/master/docs/man.md>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

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

- Nix - g-ls: normalized package name match | nixpkgs package indexes: pkgs/by-name/g-/g-ls/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - g-ls: normalized package name match | MacPorts ports tree: sysutils/g-ls/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Debian apt - g++ - 4:14.2.0-1: installed executable or alias match | Debian stable package indexes: g++ from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU C++ compiler
- Ubuntu apt - g++ - 4:13.2.0-7ubuntu1: installed executable or alias match | Ubuntu 24.04 LTS package indexes: g++ from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNU C++ compiler
- apk - g++ - 15.2.0-r8: installed executable or alias match | Alpine Linux edge package indexes: g++ from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GNU C++ standard library and compiler | https://gcc.gnu.org
- dnf - gcc-c++ - 16.1.1-4.fc45.1: installed executable or alias match | Fedora Rawhide package metadata: gcc-c++ from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | C++ support for GCC | http://gcc.gnu.org
- Scoop - main/g: installed executable or alias match | Scoop official bucket manifest trees: bucket/g.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/g-ls.yml](https://github.com/mxcl/pkgdb/blob/main/combined/g-ls.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
