From 0b61c98659e87c4e0f98b65d68c98ac4d3bf0818 Mon Sep 17 00:00:00 2001 From: mg Date: Mon, 13 Feb 2023 09:41:26 +0100 Subject: [PATCH] =?UTF-8?q?psk=20entfernt,=20rgi/rgf=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bash_extra | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.bash_extra b/.bash_extra index f89cfe0..6dc7d54 100644 --- a/.bash_extra +++ b/.bash_extra @@ -85,21 +85,6 @@ function m2m { fi fi } -#function psk { -# if [[ "$1" == "--help" ]]; then -# echo "Beende Prozess "\$1"" -# echo "" -# echo " Usage: psk " -# else -# if [ -z "$1" ]; then -# echo "[ERROR] Prozessname fehlt..." -# else -# ps -ef | grep "$1" | grep -v grep | awk '{ print $2 }' | xargs kill -9 -# fi -# fi -#} - - function rgf { if [[ "$1" == "--help" ]]; then echo "Finde alle Dateien die "\$1" im Namen haben." @@ -112,10 +97,10 @@ function rgf { return 1 fi if command -v rg >/dev/null ; then - rg --files -g *"$1"* --hidden + rg --ignore-case --files --hidden --glob=!.git/ *"$1"* else echo "[INFO] ripgrep ist nicht installiert... suche mit 'find'" - find . -type f -name *"$1"* + find . -type f -not -path '*/\.git/*'; -name *"$1"* fi } function rgi { @@ -130,10 +115,10 @@ function rgi { return 1 fi if command -v rg >/dev/null ; then - rg -i "$1" + rg --ignore-case --hidden --glob=!.git/ "$1" else echo "[INFO] ripgrep ist nicht installiert... suche mit 'grep'" - grep -r -n -i "$1" . + grep --recursive --line-number --ignore-case --exclude-dir=".git" "$1" . fi } function ssh {