// Use shell to search for multiple files <br/> find. -type f | xargs grep flash <br/> description: <br/> find the files in the front directory and Its subdirectories that contain flash files <br/> // <br/> record the xargs command: <br/> xargs obtains the parameter list and one row in the standard input, and then sends them to another command in a large group (determined by the ARG_MAX value of the host, this command is used as the xargs parameter. <br/> how to view ARG_MAX values: <br/> getconf ARG_MAX <br/> // <br/> Search for multiple files and replace them with commands. <br/> grep flash $ (find. -type f) <br/> Note: <br/> $ () is used to replace commands, and shell commands are used in parentheses; shell executes the command in parentheses and returns the entire $ (...) replace with the output of the command <br/> there are two types of command replacement: $ (), and two reverse quotation marks pair find. -type f Branch
// Replace-sed in multiple files <br/> to ensure that the unreplaced file is not replaced, find out which will be replaced in the file <br/> find-type f! -Path '*. svn * '| xargs sed-n'/Ookong inc/P' <br/> Note: <br/> 1. find is filtered out first. svn directory and Its subdirectories <br/> 2. xargs sends parameters to the sed command <br/> 3. sed performs search, print only the rows that meet the requirements <br/> // replace <br/> find-type f! -Path '*. svn * '| xargs sed-I's/Ookong inc/Ookong Ltd. co. /G' <br/> Note: <br/> 1. The sed I option is directly replaced in the file, instead of printing the replacement result. <br/> 2, g. replace all the matches in each line. <br/> // <br/> In addition, a perl multi-file search program: ack <br/> -- display the row number and file