#!/usr/bin/env bash IFS=':' read -r -a paths <<<"${PATH}" for directory in "${paths[@]}"; do [ -d "${directory}" ] && find "${directory}" -type f -perm /u+s,g+s -ls done