I would like to find all files which reside in any directory foo. For example, consider the following files:
foo/w a/foo/x a/b/foo/y a/b/c/foo/z a/b/c/foo/bar/n I would like to find the files w,x,y,z and get them listed as above, i.e., with their relative paths. My attempt was something like
$ find . -path '**/foo' -type f which doesn't work. Any ideas?The search should not include file n, i.e., only files whose parent directory is named foo we are interested in.