Linux ag安装教程

创建ag.sh文件

输入:

    set -x
    TEMP_DIR=$(mktemp -d Leslie.Guan.XXXXXX)
    cd ${TEMP_DIR}
    wget https://github.com/ggreer/the_silver_searcher/archive/master.zip
    TAR_DIR=$(unzip *.zip)
    TAR_DIR=${TAR_DIR%%/*}
    TAR_DIR=${TAR_DIR##*:}
    cd ${TAR_DIR}
    apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev --force-yes
    ./build.sh && make install
    cd ../../
    rm -rf ${TEMP_DIR}
    ag -V
    set +x 

运行ag.sh。

grep -rn "ANR in\|ANRManager: Reason:\|ANRManager: Android time\|am_anr\|WATCHDOG KILLING SYSTEM PROCESS\| iowait\| Blocked\| held by thread\| waiting to lock"
高效的过滤命令,虽然grep很好用,文件超大的时候还是ag速度快
ag "ANR in|ANRManager: Reason:|ANRManager: Android time|am_anr|WATCHDOG KILLING SYSTEM PROCESS| iowait| Blocked| held by thread| waiting to lock"

 

posted @ 2020-09-08 20:14  LB笨小孩  阅读(1031)  评论(0编辑  收藏  举报