How do I grep recursively?

The first parameter represents the regular expression to search for, while the second one represents the directory that should be searched. In this case, . means the current directory. Note: This works for GNU grep, and on some platforms like Solaris you must specifically use GNU grep as opposed to legacy implementation. For Solaris this … Read more

How do I grep recursively?

The first parameter represents the regular expression to search for, while the second one represents the directory that should be searched. In this case, . means the current directory. Note: This works for GNU grep, and on some platforms like Solaris you must specifically use GNU grep as opposed to legacy implementation. For Solaris this … Read more

What is newline character — ‘\n’

From the sed man page: Normally, sed cyclically copies a line of input, not including its terminating newline character, into a pattern space, (unless there is something left after a “D” function), applies all of the commands with addresses that select that pattern space, copies the pattern space to the standard output, appending a newline, and deletes … Read more

How to pretty print XML from the command line?

This utility comes with libxml2-utils: Perl’s XML::Twig This command comes with XML::Twig perl module, sometimes xml-twig-tools package: xmlstarlet This command comes with xmlstarlet: tidy Check the tidy package: Python Python’s xml.dom.minidom can format XML (works also on legacy python2): saxon-lint You need saxon-lint: saxon-HE You need saxon-HE: