Using the below one liner I do what the $subject of the post says:
sed -e '/^;/d' -e '/^$/d' /etc/php.ini > /tmp/php.ini-stripped
-e '/^;/d' -- deletes the lines starting with ; and this can be changed to # of course;
-e '/^$/d' / -- deletes the white lines resulted after the above command;
# perl -lane 'print if !/^;/&!/#.*/&!/^$/' /etc/fstab
ReplyDeletefor any of them (; # white lines)
Also doable with egrep -v '#|;|^$' /etc/apache2/apache2.conf
ReplyDelete