When I changed the column name in Rails, it was troublesome to find the column name before the change and fix it to the column name after the change, so I will write this article this time.
$ find ./ -type f -print | xargs grep 'hoge'
find
Search for files under the directory specified after find.
The file search syntax is "find [path] [search condition] [action]"
./
The search target is under the current directory. If you enter "~ /", the search target will be under the home directory.
You can use the full path instead of ./. In this case as well, the search target is under the specified directory.
-print
Output search results as standard. At this time, the result is displayed with the full path.
-type f
Search for the specified file type. If f is a normal file, c or d is a directory, and l is a symbolic link.
xargs
Create a command line from standard input and run it
grep
Search for a string in a file. Specify the character string you want to search after grep.
http://kawatama.net/web/1141