Remove HTML Tags from a File

This a useful one-liner using sed to remove all the HTML tags from a file:


sed -e ‘s/<[^>]*>//g’ foo.html

The Conversation

Follow the reactions below and share your own thoughts.

6 Responses to “Remove HTML Tags from a File”

  1. October 14, 2008 at 3:15 pm, Christoffer said:

    Thank You.. You also saved my day.

    Reply

  2. November 20, 2008 at 4:57 am, Anonymous said:

    Awesome! Thanks heaps for sharing

    Reply

    • November 26, 2008 at 5:58 pm, Tex said:

      Thanks a lot!!!!!!!!!!!!!!

      Reply

  3. February 16, 2012 at 10:22 am, cinas said:

    Great, very simple and just works ;)

    Reply

  4. September 26, 2012 at 1:00 pm, janem said:

    Thanks a lot, handy little thing

    Reply

  5. December 23, 2012 at 4:07 am, Vlad said:

    Damn u just save my day, thx bro!

    Reply

Leave a Reply

You may also like-

Strip comments from a fileStrip comments from a fileThis one liner will remove all text after the # character in a file cat file-with-comments | sed -e 's;#.*;;' -e '/^[ ]*$/d'Windows Live Photo Gallery 2011: Remove personal informations from photos before sharingWindows Live Photo Gallery 2011: Remove personal informations from photos before sharingWindows Live Photo Gallery is great for organizing and sharing your photos to many popular services, such as Windows Skydrive, Flickr or Facebook. While ...