源码安装ag搜索工具

1、运行环境

系统:centos7  

内核版本: Linux localhost 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

2、安装ag工具

 2.1 下载源码

  wget https://github.com/ggreer/the_silver_searcher/archive/master.zip

 2.2 安装需要的工具包

  yum -y install pcre-devel xz-devel zlib-devel

2.3 解压代码安装工具

 解压代码,进入the_silver_searcher-master执行./build.sh进行编译,编译之后执行sudo -s make install 进行安装

 [test@localhost ~]$ unzip master.zip

 [test@localhost ~]$ cd the_silver_searcher-master/
 [ test@localhost the_silver_searcher-master]$ ./build.sh 

//执行安装

 [ltj@localhost the_silver_searcher-master]$ sudo -s make install

需要注意的是如果不指定安装路径默认ag工具是安装到/usr/local/bin目录下。如果这时候系统中环境变量没有,会出现找不到情况。需要把/usr/local/bin添加到环境变量中。

 [test@localhost ~]$ export

declare -x PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:

3、效果

使用ag -i + 查找的字符串就可以查询了。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值