searchCD, fastdu upgrade, whatismyip.. try out!

This commit is contained in:
Ville Rantanen
2017-04-26 09:06:06 +03:00
parent 4ea82390d1
commit 9f91ee1654
4 changed files with 70 additions and 10 deletions

View File

@@ -209,6 +209,24 @@ function ncd() {
fi
}
function scd() {
# search cd, find first recursively match in a folder
[[ "$1" = "-h" ]] && {
echo Search cd. First argument path to search, optionally second argument where to search from.
return
}
local cdto cdfrom
[[ -z "$2" ]] && {
cdfrom="."
} || {
cdfrom="$2"
}
cdto=$( find "$cdfrom" -mindepth 1 -type d -iname "*$1*" | sort -V | head -n 1 )
echo $cdto
[[ -z "$cdto" ]] && return
\cd "$cdto"
} # scd ends
## File processing functions
function foldermenu_prompt {