How to echo directories containing matching file with Bash?

find . -name '*.class' -printf '%h\n' | sort -u

From man find:

-printf format

%h Leading directories of file’s name (all but the last element). If the file name contains no slashes (since it is in the current directory) the %h specifier expands to ".".

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)