Find and replace text within a file using sed
The procedure to change the text in files under Linux/Unix using sed:
- Use Stream EDitor (sed) as follows:
- sed -i 's/old-text/new-text/g' input.txt
- The s is the substitute command of sed for find and replace
- It tells sed to find all occurrences of ‘old-text’ and replace with ‘new-text’ in a file named input.txt
- Verify that file has been updated:
- more input.txt
Remove CTRL-M characters from a file in UNIX
1) Open the file in vi
2) Type the following
3) Press enter
to the ^M you have to type CTRL+V and then CTRL+M
It looks fairly easy, just make sure you have a H00 and a Trox T6 before you start.
If you’re planning to reinstall OS X, make sure you have created a USB boot “disk” before had as well.
See my instructions for that HERE.