Command used, on a zsh 5.6.2 installation: for def in src/*; { [[ -n $(find /usr/share/zsh/functions -name ${def:t}) ]] && git rm $def } Closes #607