If possible, can you give a short explanation on how does this linux command
sudo find . | xargs grep -i 'NameOfFunction'
work? Thanks.
It simply uses the pipe operator and xargs to pass output from the find command into the grep command:
1. sudo
runs the command as root (after prompting you for a password) allowing the find command to list system files owned by root and files owned by other users
2. find .
will cause the find command to list all files it finds starting from the current directory
3. The pipe operator "|" passes/redirects the output from the find command to grep via the xargs command.
4. grep -i 'matrixCal'
will search the listed files and output any which contain the text 'matrixCal'.
The "-i" switch causes grep to ignore the case of the search string.
That's basically how Nonshatters suggested command works. But running that will soon fill your terminal with results and error messages from grep and will take a long time to run as it will search every file in the file-system.
One way of speeding up searches is to use a built-in update script to update the database that find uses. Running this from time to time can aid in speedier searches.
I tend to run this at least once a month, if not once a week.
I usually do it manually, but you could set up a cron job to run it automatically if …