Learning Linux Lesson 31 Using SED to clean config files

4,749 views · Published 28 February 2013 · 11:14 · Indexed 14 October 2026

Channel: theurbanpenguin · 2013 · Education

Watch on YouTube

More videos like this online at http://www.theurbanpenguin.com
In this video we see the power of the Linux command line using SED. We have seen many configuration files that are documented with commented lines and blank lines. This is fine and easy to maintain by deleting lines that begin with a # or begin with the end of line marker $. However if the line is indented and then commented it is is much more difficult. Was it tabbed in, spaced in and and how many spaces. Fortunately regex can help with this with POSIX notation. It look ugly but works: '/^[[:space:]]\{1,\}/d' . Watch the video and see the magic happen

More from this channel