Mail logs are incredibly difficult to read. How could I output a blank line between each line printed on the command line? For example, say I'm grep-ing the log. That way, multiple wrapped lines aren't being confused.
sed G # option: g G Copy/append hold space to pattern space.
G is not often used, but is nice for this purpose. sed maintains two buffer spaces: the “pattern space” and the “hold space”. The lines processed by sed usually flow through the pattern space as various commands operate on its contents (
p, etc.); the hold space starts out empty and is only used by some commands.
G command appends a newline and the contents of the hold space to the pattern space. The above sed program never puts anything in the hold space, so
G effectively appends just a newline to every line that is processed.
If it's for more than just have look, I prefer to send them to a text file and open with a text editor so you can set the lines to wrap or not and do searches easily... and delete the unwanted lines and so on without having to type a lot of commands.
cat file.log > log.txt
gedit log.txt or a terminal editor like nano
cp file.log log.txt wich is of course easier and faster... thanks to KeithB comment