Linux content batch replacement command

Time:2022-1-15

Today’s work needs, in fact, a line of command,
For example, replace all ABC files containing ABC with def

find -type f | xargs perl -i -pe s%abc%def%g

If you want to replace the contents of the subdirectory together

ls -R | xargs perl -i -pe s%abc%def%g

Recommended Today

VBS tutorial: VBScript statement function statement

Function statement statementFunctionThe name of the procedure, its parameters, and the code that makes up its body. [Public [Default]| Private] Function name [(  arglist)][statements][name = expression][Exit Function] [statements][name = expression]End Function parameter Public expressFunctionProcedures can be accessed by all other procedures in all scripts. Default Only withClassIn blockPublicKeywords are used together to representFunctionProcedure is the […]