If you have ever come across a text file that has some unnecessary characters added before file/directory paths & you need to get rid of that, how would you do it? E.g.
Easy way, just edit the file and that’s it 😀
Good one 🙂 But what if the file has hundreds of lines? 😉
So, below is how to do it inside Vi editor 🙂 Open the file & issue this –
Mission accomplished 😀
Since there was ./ in path, we escaped that using \ Then there were two // so we escaped them using \/\/ And since we had to replace it with a /, we added another /\/
Syntax of replacing text in Vi is –