Ok , i m playing with egrep command and i am a little stuck in these (i have researched google and MAN pages already ):
1.i need to search files using EGREP in the /var/log directory that contain the word 'su' (case sensitive) at EITHER the END of a line OR the beginning of the line. Add two lines of context AFTER each keyword found. (i can accomplish everything BUT the END of the line with the following command:).
egrep –A 2 ‘^(su)\b’ /var/log/*
2.. Search all files directly under ~ that contain either the word 'whether' or 'wither.' Make sure that each word found is prefaced by the number of the line on which it occurs, and output your results to a file called 'my.search.' (with the following command i get WITHER but no WHETER).
Egrep –n ‘w[hei]ther’~/* > my.search
3.. Find all DIRECTORIES under the current directory which include 'tmp' in its name. (I tried the following command with no luck : )
Find . –name tmp
Any idea anyone in what i am doing wrong here ?
Thank you for your assistance .