Code to grep file

Posted: July 28, 2011 in archlinux, Debian, Freebsd, Slackware, squid

This is simple code to grep file …

This code using by other to grep squid configurations and other like apache.conf.

# cat /etc/squid/squid.conf | sed ‘/ *#/d; /^ *$/d’

(thanks to kotnik for small sed trick)

to safe file use this

# cat /etc/squid/squid.conf | sed ‘/ *#/d; /^ *$/d’ > /etc/squid/squid.conf-new

to view or search something in squid access.log use this command

# grep ‘string-to-search’ /var/log/squid/access.log

Simple trick but you can use it…

### http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html

Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s