bash: rgf verbessert
This commit is contained in:
parent
7def120769
commit
a7e54e50a8
1 changed files with 19 additions and 6 deletions
|
@ -1,11 +1,5 @@
|
|||
# rg, gibt nur Dateipfade aus, sucht nur nach Dateinamen
|
||||
function rgf {
|
||||
rg --files -g "*$1*"
|
||||
}
|
||||
}
|
||||
function ffind {
|
||||
find $1 -type f -name $2
|
||||
}
|
||||
ssh() { #() ist die kurzform von function
|
||||
tmux rename-window "$*"
|
||||
command ssh "$@"
|
||||
|
@ -57,3 +51,22 @@ function psk {
|
|||
fi
|
||||
fi
|
||||
}
|
||||
function rgf {
|
||||
if [[ "$1" == "--help" ]]; then
|
||||
echo "Finde alle Dateien die "\$1" im Namen haben."
|
||||
echo "rgf"
|
||||
echo "rgf <string>"
|
||||
else
|
||||
if [ -z "$1" ]; then
|
||||
echo "Suchbegriff fehlt..."
|
||||
else
|
||||
if [[ $(which rg) ]]; then
|
||||
rg --files -g *"$1"* --hidden
|
||||
else
|
||||
echo "ripgrep ist nicht installiert... suche mit 'find'"
|
||||
find . -type f -name *"$1"*
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue