

macOS sed replace content and write it to file
find . -name '*.php' | xargs -I{} sed -i '' 's/strA/strB/' {}
find
This manual page documents the GNU version of find. GNU find searches the directory tree rooted at each given starting-point by evaluating the given expression from left to right, according to the rules of precedence (see section OPERATORS), until the outcome is known (the left hand side is false for and operations, true for or), at which point find moves on to the next file name. If no starting-point is specified, `.' is assumed.If you are using find in an environment where security is important (for example if you are using it to search directories that are writable by other users), you should read the `Security Considerations' chapter of the findutils documentation, which is called Finding Files and comes with findutils. That document also includes a lot more detail and discussion than this manual page, so you may find it a more useful source of information.
sed
Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). While in some ways similar to an editor which permits scripted edits (such as ed), sed works by making only one pass over the input(s), and is consequently more efficient. But it is sed's ability to filter text in a pipeline which particularly distinguishes it from other types of editors.- -n, --quiet, --silent
-
- suppress automatic printing of pattern space
- --debug
-
- annotate program execution
- -e script, --expression=script
-
- add the script to the commands to be executed
- -f script-file, --file=script-file
-
- add the contents of script-file to the commands to be executed
- --follow-symlinks
-
- follow symlinks when processing in place
- -i[SUFFIX], --in-place[=SUFFIX]
-
- edit files in place (makes backup if SUFFIX supplied)
- -l N, --line-length=N
-
- specify the desired line-wrap length for the `l' command
- --posix
-
- disable all GNU extensions.
- -E, -r, --regexp-extended
-
- use extended regular expressions in the script (for portability use POSIX -E).
- -s, --separate
-
- consider files as separate rather than as a single, continuous long stream.
- --sandbox
-
- operate in sandbox mode (disable e/r/w commands).
- -u, --unbuffered
-
- load minimal amounts of data from the input files and flush the output buffers more often
- -z, --null-data
-
- separate lines by NUL characters
- --help
- display this help and exit
- --version
- output version information and exit
If no -e, --expression, -f, or --file option is given, then the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read.
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <[email protected]>.
Recommend
search keywords
Recent search keywords
- lines+to+columns
- transpose+lines+to+columns
- transpose
- lines to columns
- transpose lines to columns
- http://www.google.com
- /etc/passwd
- odt+to+html
- odt to html
- opkg_conf_load:+Could+not+lock+/var/lock/opkg.lock:+Resource+temporarily+unavailable.
- opkg_conf_load: Could not lock /var/lock/opkg.lock: Resource temporarily unavailable.
- gl.inet+axt1800+openwrt+install+passwall
- gl.inet axt1800 openwrt install passwall
- warn[0000]+mmdb+invalid,+remove+and+download
- WARN[0000]+MMDB+invalid,+remove+and+download
- warn[0000] mmdb invalid, remove and download
- WARN[0000] MMDB invalid, remove and download
- ls
- OpenWRT+install+passwall
- GL.iNet+AXT1800+OpenWRT+install+passwall
- OpenWRT install passwall
- GL.iNet AXT1800 OpenWRT install passwall
- passwall
- sft1200_buddha
- cmdline
- cmdlind
- csv
- wind
- -be
- -s
- public+ip
- bash
- history
- public ip
- nginx