#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/files-find find-file-dwim () { local name=$1 local in_path=$(pwd | grep $USER) if [[ -z $in_path ]]; then sudo find / -name $name else find ~ -name $name fi } alias ff=find-file-dwim find-file-dwim-wc () { local str=$1 find-file-dwim \*${str}\* } alias ffs=find-file-dwim-wc