From a9c09b8692f0245d77b632a59069d46ceef2c5b2 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 10 Sep 2020 10:09:35 -0400 Subject: [PATCH] Create function and alias for ag stats --- aliases | 1 + functions | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/aliases b/aliases index eb0a149..1308862 100644 --- a/aliases +++ b/aliases @@ -3,6 +3,7 @@ alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias a="ls -l --human-readable --all --color=auto" +alias agc="ag-count" alias agh="ag --hidden" alias awsp="aws-profile" alias b="bundle" diff --git a/functions b/functions index c7b2db0..cf964b5 100644 --- a/functions +++ b/functions @@ -122,3 +122,13 @@ function yarn-install-like-bundle { yarn install fi } + +function ag-count { + if [ $# -lt 1 ]; then + echo Usage: ag-count SEARCHTERM + else + searchterm=$1; shift + + ag --stats $searchterm | tail -n5 + fi +}