


Without them -type f -name … -o -name … would not do what we want.Īnd there is -regex. If you want literally or then use -o (logical OR): find.

This is to protect them from being expanded by the shell (compare this question). Use -maxdepth 1 or (if your find doesn't support it) read this: Limit POSIX find to specific depth. These patterns are not regular expressions.This fits cases where you want the filename to match several patterns at once. Here filename is taken to be the rightmost component of a files full path name. (Of course, this is ambiguous if a filename contains a newline character.) So the problem is the receiving end 'choking' when it gets a space, which means you have to tell us what the receiving end is if you want a meaningful answer. The default behavior is to join tests with -a (logical AND). The -name filename option tells find to select files that match filename. at 15:56 7 bug: find formats the file names just fine they are written one name per line. Your task can be done with find (not the shell) actually performing some matching. Or except if the shell returns a directory name (possibly among other names) in such case printf will just print it, while find will print it plus paths to every file in the directory, recursively. dockerignore in the root directory of the context.
#Bash find file named how to#
Both printf and your find only print what the shell supplies except if there is no match. Find all the available commands you can use in a Dockerfile and learn how to use. Then find gets possibly many arguments as its starting points and no tests, no actions. It's your shell who expands file*foo*txt before find even runs. The command find file*foo*txt doesn't really use find.
