Task
Task
4.use grep to look for files which contains the word for instance 'HTTP'
grep -r 'http' /etc (is used to search for the pattern 'http' within all files and
subdirectories under the /etc directory recursively)
8. grep two lines of leading and trailing context surrounding each match
grep -c 2 'support' task2 ( this will match pattarn and print line and also print
two lines after and before lines of a matched pattern line)
VIM COMMAND:
:%s/0306/92/g
4.replace 0 from start of every number with 921
:%s/0/921/g
1. Each line starts with datetime then log type, count 'Sent SMS' logs.
grep -c 'Sent SMS' test.log
2.Get output which contains the first 10 'Sent SMS' logs on terminal
grep 'Sent SMS' test.log | head -n 10
3.Get output which contains the first 25 'Sent SMS' logs on terminal.
grep 'Sent SMS' test.log | head -n 25
4.Get output which contains the last 15 'Sent SMS' logs on terminal
grep 'Sent SMS' test.log | tail -n 15