Saturday, February 19, 2022

Print Everything But Comments and Empty Lines

Here's a simple way to display every line except for comments and blank lines from a file like /etc/ssh/sshd_config:

Code


grep -v '^#' /etc/ssh/sshd_config | grep -v '^$'
    



This work is licensed under the Creative Commons Attribution 3.0 Unported License.