What is the correct syntax for:
find . -type f -name \*.\(shtml\|css\)
This works, but is inelegant:
find . -type f -name \*.shtml > f.txt && find . -type f -name \*.css >> f.txt
How to do the same, but in fewer keystrokes?
|
What is the correct syntax for:
This works, but is inelegant:
How to do the same, but in fewer keystrokes?
| |||
|
feedback
|
|
You can combine different search expressions with the logical operators
This also show that you do not need to escape special shell characters when you use quotes. Edit Since | |||||||||||||
feedback
|
|
You need to parenthesize to only include files:
Bonus: this is POSIX-compliant syntax. | ||||
|
feedback
|
|
Here is one way to do your first version:
| |||||
|
feedback
|
|
I often find myself ending up using egrep, or longer pipes, or perl for even more complex filters:
It may be somewhat less efficient but that isn't usually a concern, and for more complex stuff it's usually easier to construct and modify. | |||
|
feedback
|