Format C/C++ source according to the Linux style guide, automatically back up the original files, and replace with the indented versions

indent

  • Change the appearance of a C/C++ program by inserting or deleting whitespace.
    More information: <https://www.gnu.org/software/indent/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

indent --linux-style {{path/to/source.c}} {{path/to/another_source.c}}

click the source code to copy install indent on any operating system with command-not-found.com