Skip to main content
Tweeted twitter.com/StackUnix/status/1174246797776183296
Became Hot Network Question
added 123 characters in body
Source Link
Max Maier
  • 473
  • 4
  • 12

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.

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 

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?

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. The search should not include file n, i.e., only files whose parent directory is named foo we are interested in.

added 68 characters in body
Source Link
Max Maier
  • 473
  • 4
  • 12

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 

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?

I would like to find all files which reside in directory foo. For example, consider the following files:

foo/w a/foo/x a/b/foo/y a/b/c/foo/z 

I would like to find the files w,x,y,z. My attempt was something like

$ find -path '**/foo' -type f 

which doesn't work. Any ideas?

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 

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?

edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266
Source Link
Max Maier
  • 473
  • 4
  • 12
Loading