Linux finds whether all files in a directory contain a certain string

Find if all files in a directory contain a certain string
find .|xargs grep -ri "IBM"

Find out if all files in a directory contain a certain string, and print only the file name
find .|xargs grep -ri "IBM" -l

find command example
   find -name "*.txt" -print Find files ending in txt and output to the screen
   find /cmd ".sh" -print Find all sh files in the /cmd directory and output
   find . -perm 755 -print Find files with a permission of 755 in the current directory, and output
   find `pwd` -user root -print Find files in the current directory whose owner is root, and output
   find ./ -group sunwill -print Find the current directory The file whose owner is sunwill
   find /var -mtime -5 -print Find all files in the /var directory that were changed within 5 days
   find /var -mtime +5 -print Find all the files in the /var directory that were changed 5 days ago file
   find /var -newer "myfile1" ! -newer "myfile2" -print Find all files in the /var directory that are newer than myfile1 but older than myfile2.
   find /var -type d -print find all directories in the /var directory
   find /var -type l -print Finds all symbolic link files in the /var directory.
   find . -size +1000000c -print Find files larger than 1000000 bytes in the current directory
   find / -name "con.file" -depth -print Find whether there is "con.file" in the root directory, if not, in its subdirectory Find in
   find . -type f -exec ls -l {} \; Find out if there are ordinary files in the current directory, if so, execute ls -l

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326285280&siteId=291194637
Recommended