Bash: How to use ‘find’ for a file with specific extension but that it would also give its previous directory

Try this:

find . -name "*.exe" -o -name "*.bat" -type f | grep -Po '[^/]*?/[^/]+$'

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top