2021-06-23 20:36:45 +02:00
|
|
|
rg --files -g "*$1*"
|
2021-06-23 20:18:14 +02:00
|
|
|
}
|
2021-08-24 08:28:27 +02:00
|
|
|
ssh() { #() ist die kurzform von function
|
2021-08-23 23:06:35 +02:00
|
|
|
tmux rename-window "$*"
|
|
|
|
command ssh "$@"
|
|
|
|
}
|
2021-11-09 10:55:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
function sgc {
|
|
|
|
case "$1" in
|
|
|
|
--help)
|
|
|
|
echo "Suche in der kompletten git-history nach '$1'"
|
|
|
|
echo "sgc = search git commit"
|
|
|
|
echo "sgc <suchbegriff>"
|
|
|
|
;;
|
|
|
|
"")
|
|
|
|
echo "Suchbegriff fehlt..."
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
git grep "$1" $(git rev-list --all)
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2021-10-23 14:29:05 +02:00
|
|
|
function m2m {
|
2021-11-09 10:55:16 +01:00
|
|
|
if [[ "$1" == "--help" ]]; then
|
|
|
|
echo "Sende Datei '$2' per Mail; Betreff = '$1'"
|
|
|
|
echo "m2m = mail2me"
|
|
|
|
echo "m2m <Pfad zu Datei> <Betreff>"
|
|
|
|
else
|
|
|
|
if [ ! -f "$1" ]; then
|
|
|
|
echo "Dateipfad fehlt..."
|
|
|
|
else
|
|
|
|
if [ -z "$2" ]; then
|
|
|
|
echo "Betreff fehlt..."
|
|
|
|
else
|
|
|
|
echo "$1" | mail -s "$1" -A "$2" michael.grote@posteo.de
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2021-10-23 14:29:05 +02:00
|
|
|
}
|
2021-11-09 11:00:29 +01:00
|
|
|
function psk {
|
|
|
|
if [[ "$1" == "--help" ]]; then
|
|
|
|
echo "Beende Prozess '$1'"
|
|
|
|
echo "psk = ps kill"
|
|
|
|
echo "psk <prozessname>"
|
|
|
|
else
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Prozessname fehlt..."
|
|
|
|
else
|
|
|
|
ps -ef | grep $1 | grep -v grep | awk '{ print $2 }' | xargs kill -9
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
2021-11-09 11:22:16 +01:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|