Replacing URLs within multiple txt files by the Linux terminal

0

I have several .txt files

Ex: arquivo1.txt arquivo2.txt arquivo3.txt

Within these files I have several urls as follows:

https://www.site.com.br/diretorio/
https://www.site.com.br/diretorio/
https://www.site.com.br/diretorio/

I would like to replace with:

https://www.novosite.com.br 

That is, a new site address and without the "/ directory /"

    
asked by anonymous 27.06.2018 / 02:16

1 answer

1

1 - View the contents of the files cat site.txt link

cat site1.txt link

2 - change the text cat site.txt site1.txt | sed - i 's, myite.com / directory, newite.com, g' *

  • View the contents of the files after the changes

cat site.txt link

cat site1.txt

link

    
27.06.2018 / 03:28