commit 251edab466e4acbff2470abc26bff69a021d00f8
parent ba87115a9d4dbf455271851f97565f907a05324e
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Wed, 29 Aug 2018 15:06:05 +0200
Alias to find in files using grep
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/dotfiles/commonprofile b/dotfiles/commonprofile
@@ -23,6 +23,7 @@ mkcd() { mkdir -p -- "$1" && cd -P -- "$1" || return; } # Mak
procinfo() { ps aux | grep "$1"; } # Get info about a process (by name)
rmempty() { find "${1-.}" -type d -empty -depth -delete; } # Remove empty directories
todos() { if [ -z "$1" ]; then 1="."; fi; grep -rnw "$1" -e "TODO"; }
+find_in_files() { grep -rnw "$1" -e "$2"; }
batterypct() { ioreg -l | awk '$3~/Capacity/{c[$3]=$5}END{OFMT="%.2f%%";max=c["\"MaxCapacity\""];print(max>0?100*c["\"CurrentCapacity\""]/max:"?")}' | sed 's/\..*//'; }
### DOUG SCRIPTS TRIAL RESET ###