centralspot.blogg.se

Bash find file named
Bash find file named








bash find file named

bash find file named

type f \( -name "*cache" -o -name "*xml" -o -name "*html" \)

#Bash find file named how to

To help you see how to expand this from finding two filename patterns to finding even more filename patterns with one find command, here's an example of how to search for three different files extensions with one find command:įind. Linux find multiple filenames command: finding three filename extensions I've tested this 'find multiple' command on several Unix systems, and it should work on all systems that support the Bash shell, including vanilla Unix, Linux, BSD, freeBSD, AIX, Solaris, and Cygwin. If you’re familiar with common Linux find commands, the only magic here is (a) using the "-o" option to say "or", and (b) escaping the parentheses with the backslash character.

bash find file named

Here's a Linux find command that shows how to find multiple filenames at one time, in this case all files beneath the current directory ending with the filename extensions ".class" and ".sh":įind. Linux find multiple filenames command - two filename patterns In short, the solution is to use the find command's "or" option, with a little shell escape magic. You can use the Linux find command to find multiple filename patterns at one time, but for most of us the syntax isn't very common. Unix/Linux find command FAQ: How can I write one Unix find command to find multiple filenames (or filename patterns)? For example, I want to find all the files beneath the current directory that end with the file extensions ".class" and ".sh".










Bash find file named