Improve this answer. Dave Jarvis Eric Wilson Eric Wilson GNU find doesn't require it — sehe. On my Cygwin, if I use the example from Eric it runs fine. But if I add a "-print" at the end it only uses the last -name filter. When I add the parenthesis it works with the -print option. Joachim I think it may be the same for you. For me on Ubuntu it appears that the parenthesis are necessary as soon as I want it to be piped e. Without it, it will still run but only use the last extension I mention.
Priyal -o is for "or" — Eric Wilson. Show 3 more comments. Thats what I use find. Pierre Lacave Pierre Lacave 2, 2 2 gold badges 17 17 silver badges 28 28 bronze badges. Unless you feel that adding -print is new and useful information, it would be better to upvote one of the existing answers rather than adding duplication.
The parantheses are important. Jan-Philip Gehrcke. Interesting, I didn't know you could use -or , I've only seen -o. Works, and easy to remember. Note that not all versions of find e. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I would like to search for files that would not match 2 -name conditions. I can do it like so :. The second expression shall not be evaluated if the first expression is true. Backslash is the escape character;.
Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How to combine 2 -name conditions in find? Ask Question.
Asked 9 years, 3 months ago. Active 1 year, 11 months ago. Viewed k times. Improve this question. Unix: How to find files with multiple filename extensions. Linux find command: How to find files not matching a pattern. Scala 3 opaque types: How to create meaningful type names. Scala 3 modules: How to build modular systems. Docker cheat sheet cheatsheet. The ideal of warriorship is Chogyam Trungpa.
0コメント