创建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"

 

相关文章:

  • 2021-08-07
  • 2021-09-26
  • 2021-12-07
  • 2021-12-07
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2021-12-14
  • 2021-04-26
  • 2021-09-12
相关资源
相似解决方案