How to search text in all files under each directory using grep grep -ir "text" directory1 directory2 directory3 ...