Grep

From Federal Burro of Information
Revision as of 15:55, 26 March 2014 by David (talk | contribs)
Jump to navigationJump to search

get rid of comments, even lines that start with space and then have comments:

more /etc/apache2/vhosts.d/default_vhost.include | egrep -v '^\s?#'

remove comments , and blanks lines:

cat /srv/gitblit-1.4.1/data/gitblit.properties | egrep -v '^\s?#' | grep -v "^\[\[:space:\]\]*$"
cat /srv/gitblit-1.4.1/data/gitblit.properties | egrep -v '^\s?#' | grep -v "^[[:space:]]*$"