Unleashing magic
unsplashunsplash
Gradient background

The Silver Searcher

Clarice Bouwer

Software Engineering Team Lead and Director of Cloudsure

Thursday, 29 August 2019 · Estimated 1 minute read

The ack utility was designed to replace 99% of the uses of grep.

As stated in the man page

Ack searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a match to the given PATTERN . By default, ack prints the matching lines. Ack can also list files that would be searched, without actually searching them, to let you take advantage of ack's file-type filtering capabilities.

Silver Searcher ag is similar to ack with a focus on spead. Without ack ag would not exist.

Installing

macOS

Copy
brew install the_silver_searcher

or

Copy
port install the_silver_searcher

Linux

  • Ubuntu >= 13.10 (Saucy) or Debian >= 8 (Jessie)

    Copy
      apt-get install silversearcher-ag
  • Fedora 21 and lower

    Copy
      yum install the_silver_searcher
  • Fedora 22+

    Copy
      dnf install the_silver_searcher
  • RHEL7+

    Copy
      yum install epel-release.noarch the_silver_searcher
  • Gentoo

    Copy
      emerge -a sys-apps/the_silver_searcher
  • Arch

    Copy
      pacman -S the_silver_searcher
  • Slackware

    Copy
      sbopkg -i the_silver_searcher
  • openSUSE:

    Copy
      zypper install the_silver_searcher
  • CentOS:

    Copy
      yum install the_silver_searcher
  • SUSE Linux Enterprise: Follow these simple instructions.

BSD

  • FreeBSD

    Copy
      pkg install the_silver_searcher
  • OpenBSD/NetBSD

    Copy
      pkg_add the_silver_searcher

Windows

  • Win32/64

    Unofficial daily builds are available.

  • Chocolatey

    Copy
      choco install ag
  • MSYS2

    Copy
      pacman -S mingw-w64-{i686,x86_64}-ag
  • Cygwin

    Run the relevant setup-*.exe, and select "the_silver_searcher" in the "Utils" category.