How to pipe make output to less

When you compile your code using make it can throw output that can run many lines. Piping this output directly to a pager like less does not work. This is because make is writing its output to the stderr stream. To get it into less this needs to be redirected to the stdout stream. That can be done like this:

$ make 2>&1 | less

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.