How to output configuration file content without comments and empty lines


Warning: Undefined array key "socialize_RedditWidget" in /home/phpacd/websites/shkodenko.com/wp-content/plugins/socialize/frontend/socialize-services.php on line 166

Warning: Undefined array key "socialize_LinkedInWidget" in /home/phpacd/websites/shkodenko.com/wp-content/plugins/socialize/frontend/socialize-services.php on line 211

Warning: Undefined array key "socialize_PinterestWidget" in /home/phpacd/websites/shkodenko.com/wp-content/plugins/socialize/frontend/socialize-services.php on line 238

Warning: Undefined array key "socialize_PocketWidget" in /home/phpacd/websites/shkodenko.com/wp-content/plugins/socialize/frontend/socialize-services.php on line 279

Warning: Undefined array key "pocket_counter" in /home/phpacd/websites/shkodenko.com/wp-content/plugins/socialize/frontend/socialize-services.php on line 280

Sometimes working in Linux you may need to output configuration file content without comments and empty lines.

In this case you can use command sequence below:

cat /etc/my.cnf |grep -v '#' |sed '/^$/d' |more

You can replace /etc/my.cnf with another configuration file name and '#' with any other comment mark e.g. ';' or '//'