Replace <br> with a line break in Nano. Tried to Atom - dies. I Inserted \n, \r, \n\r but, inserted simply as characters. How do I insert a line break + taboolation? File is .Html.





1 Answer 1


You need to use something like vim instead of nano.

Open the file using vim and press esc and then type:


and then press enter

To save the file and exit, run the following sequence of keys which will write the file (save) and quit vim:

press esc and then type:


and then press enter

Click here to view a related question which explains why this cannot be done using nano.

Alternatively, you could use sed to edit the file.

Here is an example:

I will use the example filename "HELLO":

sed -i 's/<br>/\n\t/g' HELLO

Furthermore, if you want to create a file instead, you can run the following command to create the file by piping the output of sed to a file using tee:

echo 'Hello<br>Hello<br>Hello' | sed 's/<br>/\n\t/g' | tee HELLO

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.