21 Examples To Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors

Originally published at: https://www.cyberciti.biz/tips/check-unix-linux-configuration-file-for-syntax-errors.html

Check for syntax errors on Linux or Unix
In Linux and UNIX system services are configured using various text files located in /etc/ or /usr/local/etc/ directory tree. A typical server system could have dozens of configuration files. You can check your configuration files for syntax errors without starting the server and validate all settings. In some cases, it is possible to check the sanity of specific data/config options and directories. Text files are easier to manage remotely. You can use ssh and a text editor. If there is an error in configuration, the server may not start. It may result in a disaster. This post explains how to quickly find out a syntax error for popular servers and test configuration file for syntax errors.