Skip to content

Keycode

More flesh, less fluff.

Tag: redirect

Redirect build outputs to a file

make &> build.txt

All build outputs including warnings and errors will be redirected to build.txt. If without &, errors and warnings will not be redirected to the file.

Author pashanhuPosted on 30/11/2020Categories C/C++Tags build, C++, make, redirectLeave a comment on Redirect build outputs to a file

2>/dev/null and 2>&1

Remove those entries that have an error of “Permission Denied” :

find /opt -name dcm 2>/dev/null

Filter the output of a program and redirect the filtered result into a file:

./bin/programA -i ... -o ... 2>&1 | grep "keywords" > a.txt
Author pashanhuPosted on 21/10/2019Categories LinuxTags /dev/null, 2>, redirectLeave a comment on 2>/dev/null and 2>&1

Recent Posts

  • Count how many tests related to a keyword via pytest
  • Count how many tests each module has via pytest
  • Make git colourful
  • A solution to “git” not working
  • How to check “gperftools” version based on “tcmalloc” library?

Recent Comments

No comments to show.
  • September 2026
  • July 2026
  • March 2026
  • December 2025
  • October 2025
  • August 2025
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • August 2021
  • November 2020
  • October 2020
  • June 2020
  • May 2020
  • February 2020
  • October 2019
  • September 2019
  • August 2019
  • Algorithm
  • AWS
  • Boost
  • C/C++
  • Debug
  • git
  • GitHub
  • GTest
  • Image/Graphics
  • Java
  • Linux
  • Node.js
  • Other
  • Python
  • Qt
  • Swift
  • Unreal Engine
Keycode Proudly powered by WordPress