Filter Logs with Grep : linux Command Grep

grep linux command

Filter Logs with Grep : linux Command Grep Let’s understand the use of grep is to extract useful information from system logs: grep -Eoc “^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.* 200” /srv/www/example.com/logs/access.log   In this command, grep filters an Apache access log for all lines that begin with an IP address, followed by a number of characters, a space and then the … Read more

grep : Linux Command

grep linux command

Searching Inside the File/Files in Linux  grep prints the matching lines Let’s have some example to understand this: Example 1: To Search for the given string in a single file  Let me create a file eduguru.sh. $ cat eduguru.sh #!/bin/bash fun() echo “This is a test.” # Terminate our shell script with success message exit 1 fun() Now … Read more