Friday 16 February 2018

UNIX find dirs that contain a particular file (pom.xml) then execute command in that dir

I want to, from a root dir, find all dirs that contain a certain file name (pom.xml), then cd to that dir and execute a command. I can do this in a script but I was hoping to do this with a single line command.


so far I have


find . -type f -name 'pom.xml' |sed 's#\(.*\)/.*#\1#'

This gives the dirs I need... now I need to cd into each and execute my command

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...