How To Use sed To Recursively Replace Text in Multiple Files

preview_player
Показать описание
Learn how to find and replace text in-place in multiple files recursively with the sed command on Linux and Unix-like operating systems.

Check out my vlog channel @TonyFlorida

#sed
Рекомендации по теме
Комментарии
Автор

Great video, thank you; it helped me a lot. Is there a way to use this same process to change multiple individual instances of a word in a file to another word. In your example you changed Tony to Antonio, but I saw where you also had some occurrences of tony in those files as well. So if you wanted to change all occurrences of a word to another word, regardless of capitalization; is that possible? Let's say I wanted to change all individual letters in a document to their phonetic equivalent (a>alpha, b>bravo, c>charlie, et al) how would I go about that?

jcallen
Автор

Hi, how to replace a set of lines in files in a folder with set of another lines in files in another folder in unix.

SakshiSharma-ttov
Автор

Great- How to replace a line from ( text file 1) to (text file 2) by using sed command and save the replaced file. Could you make a video for that ?

keyanviews
Автор

Great Tutorials as always 👍
Can You Please Make a Video on "Installing aaPanel on DigitalOcean Server"? Waiting for that

AliRaza-uzud
Автор

I have data like "Chair"||"Table"|||"Sofa".. How to add double quotes between each pipeline like .. Please let me knw the command . will sed help this

navasr
Автор

Interesting - but I wish you continued to inserting a text in multiple txt files as opposed to replacing them :-)

Snacksmonster
Автор

Hi, how can I replace insert text in a specified location

nguyenduythinh
Автор

The recurvsive thing here is not a "sed" command facility but a "find" comand one.

bendover
Автор

Tony, would this work if we were to replace Amazon Affiliate ID from Amazon URL?

dev_manish
Автор

Tony! you have plenty of good stuff to share...relax, slow it down. STOP speaking continuously. Speak slower. Speak in short phrases. Pause between phrases. Give your viewers two or three seconds to digest what you said. Most of all STOP talking rapidly continuously! Good luck to you.

basalduat
Автор

Or, if your files don't all have the same extensions, or extensions at all:
$ find . -type f -exec sed -i 's/find/replace/g' {} \;

dxmajrd
Автор

how can I do it, without replacing and direct the result to another output directory, I tried this but didnt work: I want to delete the first line in some files and direct it to the same files name but another directory: find . -name "*summary*.*" -exec sed '1d' > clean_output/{} \;

sarakhastoo
Автор

what is my string contains mulitple times /

sameerap