4 added 3 characters in body
source | link

I have a few directories, some with a depth of 3, which contain mixed file types. What I need to do is to rm -rf all the directoriessubdirectories that do not contain filetype foo.

Is this achievable with find somehow? I do know that I can use find like this:

find . ! -name '*.foo' -delete

to delete all files within the directories that do not contain any file of type *.foo. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain *.foo?

I have a few directories, some with a depth of 3, which contain mixed file types. What I need to do is to rm -rf all the directories that do not contain filetype foo.

Is this achievable with find somehow? I do know that I can use find like this:

find . ! -name '*.foo' -delete

to delete all files within the directories that do not contain any file of type *.foo. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain *.foo?

I have a few directories, some with a depth of 3, which contain mixed file types. What I need to do is to rm -rf all the subdirectories that do not contain filetype foo.

Is this achievable with find somehow? I do know that I can use find like this:

find . ! -name '*.foo' -delete

to delete all files within the directories that do not contain any file of type *.foo. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain *.foo?

3 remove tag name from title
| link

[bash] use 'find' to search for directories !containing certain filetype foo

    Tweeted twitter.com/#!/StackUnix/status/42454907600633856
2 deleted 35 characters in body
source | link

I have a few directories, some with a depth of 3, which contain mixed file types. What iWhat I need to do is to rm -rf all the directories that do not contain filetype foo.

CouldIs this is be achievable e.g. with find somehow? I do know, that I can use find like this:

 `enter code here`findfind . ! -name '*.foo' -delete

to delete all files within the directories that do not contain any file of type *.foo. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain *.foo?

I have a few directories, some with a depth of 3, which contain mixed file types. What i need to do is to rm -rf all the directories that do not contain filetype foo.

Could this is be achievable e.g. with find somehow? I do know, that I can use find like this:

 `enter code here`find . ! -name '*.foo' -delete

to delete all files within the directories that do not contain any file of type *.foo. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain *.foo?

I have a few directories, some with a depth of 3, which contain mixed file types. What I need to do is to rm -rf all the directories that do not contain filetype foo.

Is this achievable with find somehow? I do know that I can use find like this:

find . ! -name '*.foo' -delete

to delete all files within the directories that do not contain any file of type *.foo. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain *.foo?

1
source | link