How to solve “Failed to download metadata for repo ‘pgdg94’ “?
OS: Cent OS 8 Task: check if there is security update then update security only…
How to search and replace a word in file in Linux?
sed -i 's/original/new/g' file.txt
Explanation:
sed
= Stream EDitor-i
= in-place (i.e. save back to the original file)s
= the substitute commandoriginal
= a regular expression describing the word to replace (or just the word itself)new
= the text to replace it withg
= global (i.e. replace all and not just the first occurrence)file.txt
= the file name