Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to pipe make output to less

📅 2013-Dec-27 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ less, make ⬩ 📚 Archive

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:

[code lang=bash] $ make 2>&1 | less ```

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧