I am trying to get the output of an ls command and search that list for a regex expression... Effectively, it will search every file name in the folder for the regex expression. I put together a simple example of what I thought was the right way to do this, but clearly was not:
$ ls ~/Desktop/testFolder | grep -rn "contents"
I know, I can make a script for this where I pipe the output from the 'ls' to a text file, and then grep that.. but I am asking how to do this WITHOUT a multistep process or script.