Tuesday, September 30, 2014

How to look for a certain word in log files using grep

I have hexchat IRC app set-up to autojoin certain channels once started,as i tend to keep my PC running 24/7 , i thought why not save the log files and then use grep to find a certain word/files later ?
the task was easy , hexchat saves the log file in folders in this path
~/.config/hexchat/logs
folders are created for every server
server1/log
server2/log and so on
after some idling time you will have a huge log files
navigate to the directory where the logs are saved (mentioned above)
I use this command to look for what i need
cat `find ./ -name '*.log'`|grep -i release.name
grep has almost infinitive possibilities when it comes to narrowing down the search results