I have several files present on an IFS path and I am not sure which file or document contains the string fail
. If I would go and search for each file on the IFS path, then it would be very time-consuming for me to find this string. Is there any quick way that I can follow to search an IFS folder for all the files contained within that folder for a specified string within that file or document?
You can do this from
Qshell
on IBM i. To start theQSHELL
, typeSTRQSH
from the command line, and theQSH command entry screen
will open. Now you can use the following command to search an IFS folder for a string within documents or files.QSH IFS search command:
grep -F -R -i "search string" /ifsfolder
grep
command searches for a pattern in a file and writes each matching line to standard output.-F
tells it to search for a flat string as opposed to a regular expression.-R
tells it to search all files and subdirectories of the directory given.-i
meancase-insensitive
. Leave this if you want to match the upper or lower case exactly. You can get more info about the grep command here.