I’m sure there are many different ways to do this however this way worked well. I’ve included an example where escaping specific characters is required which adds a little more complexity as they must be escaped using the ‘\’ character.
Useful bash Operations
Introduction A list of solutions for common problems working in a bash shell. Will update as I find them. Find two words existing on the same line https://stackoverflow.com/questions/6480687/grep-for-2-words-existing-on-the-same-line To grep for 2 words existing on the same line, simply do: