Backup and Replace a file using SED

Here i want to replace all .html files in a directory and before that i want to take a backup of all the .html files as well

# find /root/sedd/ -name "*.html" -exec sed -ie '/<\/html>/q0'{} \; ; [ $? = 0 ] && echo "Succesfully replaced and backup all index files with an extension of e"

After this the .html files are backedup with file.htmle and orginal files will remove from the server.


Terima kasih telah membaca artikel tentang Backup and Replace a file using SED di blog Tutorial Opensource and Linux jika anda ingin menyebar luaskan artikel ini di mohon untuk mencantumkan link sebagai Sumbernya, dan bila artikel ini bermanfaat silakan bookmark halaman ini di web browser anda, dengan cara menekan Ctrl + D pada tombol keyboard anda.

Artikel terbaru :