The command that can search the contents of a file is "grep", but some people are migrating with the appearance of "grab", "ack", "ag", etc. that speed up the grep.
This time, ** ag ** of rumored to be particularly early among them [^ 1] is posted on GitHub document on CentOS8 virtually built with VirtualBox / Vagrant. I tried to install it with the following command. However...
--The result is the same with yum
$ sudo dnf update
$ sudo dnf install the_silver_searcher
--I get the following error and cannot install
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:04:22 ago on Wed Nov 18 17:23:56 2020.
No match for argument: the_silver_searcher
Error: Unable to find a match: the_silver_searcher
However, as mentioned above, I got an error and could not install it, so I will explain how to do it well. By the way, I will do the same for Mac and Ubuntu.
CentOS8 --Version confirmation
$ cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)
--Installation
-- README.There are the following two descriptions in md dependencies
$ sudo dnf -y groupinstall "Development Tools"
$ sudo dnf -y install pcre-devel xz-devel zlib-devel
$ cd /usr/local/src
$ sudo git clone https://github.com/ggreer/the_silver_searcher.git
$ cd the_silver_searcher/
$ sudo ./build.sh
$ sudo make install
--Make sure it contains ag
$ which ag
/usr/local/bin/ag
Ubuntu --Version confirmation
$ cat /etc/os-release
--Partially omitted
VERSION="20.04.1 LTS (Focal Fossa)"
--Installation
$ apt update
$ sudo apt install silversearcher-ag
--Make sure it contains ag
$ which ag
/usr/bin/ag
MacOS --Version confirmation
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H15
--Installation
$ sudo brew install the_silver_searcher
--Make sure it contains ag
$ which ag
/usr/local/bin/ag
In the future, I plan to find time to write a light article on how to use ag and how to compare it with grep. : rocket: That's all for today.
[^ 1]: It is overwhelmingly faster as the author's sense value 3 to 5 times faster than ack, which is faster than grep There is also information that. However, there is also a dissenter, and the author has not verified it numerically, so I cannot make a statement here. sorry.
Recommended Posts