simple bash program using find
Im working on a small project and Ive looked, what seems like everywhere, for an answer. My question is Im trying to create a bash shell that will take in two variables and search for files that contain both of the listed arguments. Just for the records, im quite new to linux, so if im making rediculously stupid mistakes thats why :)
one of the million things ive tried :
I have looked for ways to include both, but I just cant seem to get it to work.
find . -name "*$1*" -print | xargs find . -name "*$2*
but even that doesnt work, im also not to sure if thats how you do AND. I saw it on a website for OR, but they did not describe how to use it properly, and I havent been able to find adequate resources on either.
find . \( -name "*$1*" -a -name "*$2*"\)
Any help would be greatly appreciated.
Thanks in advance,