How do you change a text file in Linux?

Thảo Justin

New member
How do you change a text file in Linux?
Answer
The procedure to change the text in files under Linux/Unix using sed:
  1. Use Stream EDitor (sed) as follows:
  2. sed -i ‘s/old-text/new-text/g’ input. …
  3. The s is the substitute command of sed for find and replace.
  4. It tells sed to find all occurrences of ‘old-text’ and replace with ‘new-text’ in a file named input.
22 февр. 2021 г.
 

Tìm kiếm

Back
Top