find grep finds file characters

If you only want .rto find a specific string in files of type , you can use the following command: 

grep -ri "universal" --include="*.r" .

-i ignore case

-r recurses all files

If you only want to find files whose file names contain "universal" and have an extension of .r, rather than the file contents, you can use the following command:

ls *.r | grep "universal"

This will list files in the current folder with the extension .rand whose filenames contain the string "universal".

Hope this helps! If you have any other questions, please feel free to ask.

Guess you like

Origin blog.csdn.net/qq_52813185/article/details/132834727