Issue
I've done this atm, I need to find in the main directory and in the sub-directory everything starting with the letter 'a', every files ending with 'z' and every files starting with 'z' and ending with 'a!'.
find . -name "a*" | find . "*z" -type f | find . "z*a!" -type f
I tried to be as clear as possible, sorry if it wasn't clear enough.
Solution
find . -type f \( -name 'a*' -or -name '*z' -or -name 'z*a!' \)
Use -o
instead of -or
for POSIX compliance.
If you really want to also find links, directories, pipes etc. starting with a
but only files matching the remaining conditions, you can do
find . -name 'a*' -or -type f \(-name '*z' -or -name 'z*a!' \)
Answered By - choroba Answer Checked By - Clifford M. (WPSolving Volunteer)