ag 又名 The silver search,是和 grep 类似的搜索软件。ag 使用 C++ 实现,支持 Windows、Linux、macOS。在搜索大量文件时速度明显优于 grep。默认系统上没有安装 ag,我们可以下载源码编译,源码地址是:https://github.com/ggreer/the_silver_searcher
编译之前安装必备的工具
1 2 |
yum -y groupinstall "Development Tools" yum -y install pcre-devel xz-devel zlib-devel |
执行脚本,自动下载、解压、编译、安装,一条龙服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
os="`python -mplatform | grep Ubuntu`" if [ $os ] then sudo apt-get install automake liblzma-dev else sudo yum install -y xz-devel zlib-devel pcre-devel sudo yum install -y wget fi wget https://github.com/ggreer/the_silver_searcher/archive/master.zip mv master.zip ag.zip unzip ag.zip cd the_silver_searcher-master/ ./build.sh sudo make install |
转载请注明:exchen's blog » CentOS 编译 ag 源码