• 过滤掉注释

    cat /etc/ntp.conf | grep -v '^#'
  • 过滤掉空行

    cat /etc/ntp.conf | grep -v '^#'
  • 过滤掉注释和空行
    cat /etc/ntp.conf | grep -Ev '^#|^$'