Command to search for a certain string in all files under a certain directory in the terminal

A0001 014256 When using vim or other software in a terminal, there are often times when you want to search for a certain string but don't know where in a file it is. Especially when an unfamiliar source is loaded with an error message or something. In such cases, you can use the following method to search at once. find -n hogeDirectory -type f -print | xargs grep hogeString /dev/null To briefly explain, first print all files in the specified directory (hogeDirectory), and then find the specified string ( hogeString) is searched. Note that if the hogeString contains . or - in the hogeString, it must be escaped with a backslash.