User Tools

Site Tools


file:replace_all_occurrences_of_string_within_a_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
file:replace_all_occurrences_of_string_within_a_file [2016/07/10 15:18] – created peterfile:replace_all_occurrences_of_string_within_a_file [2019/11/27 21:28] (current) – removed peter
Line 1: Line 1:
-====== File - Replace all occurrences of string within a file ====== 
  
-Change all references of the word dog to cat in the file: 
- 
-<code bash> 
-sed -e 's/dog/cat/g' filename 
-</code> 
- 
-This uses **sed** to stream edit files, which means change them on the fly. 
- 
- 
-# See more examples here http://www.pantz.org/software/shell/shelloneliners.html 
file/replace_all_occurrences_of_string_within_a_file.1468163931.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki