Escape the .
:
sed 's/foo\./foo_/g' file.php
Example:
~$ cat test.txt
foo.bar
~$ sed 's/foo\./foo_/g' test.txt
foo_bar
More Related Contents:
- Find and replace with sed in directory and sub directories
- How to change the output color of echo in Linux
- How can I search for a multiline pattern in a file?
- How to remove the lines which appear on file B from another file A?
- Environment variable substitution in sed
- Delete empty lines using sed
- How do I use sed to change my configuration files, with flexible keys and values?
- Appending a line to a file only if it does not already exist
- Uninstall Node.JS using Linux command line?
- Get most recent file in a directory on Linux
- Return value of sed for no match
- Using curl to send email
- How to count lines in a document? [closed]
- Perl command line multi-line replace
- How do I include a pipe | in my linux find -exec command?
- Removing Windows newlines on Linux (sed vs. awk)
- Uppercasing First Letter of Words Using SED
- Linux command to list all available commands and aliases
- extracting unique values between 2 sets/files
- Execute command after every command in bash
- How do I remove newlines from a text file?
- Using grep and sed to find and replace a string
- How to check if sed has changed a file
- Execute combine multiple Linux commands in one line
- View tabular file such as CSV from command line [closed]
- Replace whitespace with a comma in a text file in Linux
- find matching text and replace next line
- Add a newline only if it doesn’t exist
- Bash script to remove ‘x’ amount of characters the end of multiple filenames in a directory?
- Why does sed fail with International characters and how to fix?