Linux grep and find command

linux command with samples

Grep

 find . | grep .log$

count how many log files

ls /var/log | grep -c .log
11

grep keyword in file

grep -e Started* /var/log/boot.log

grep keyword in file and use -n to print line number

grep -e Started* /var/log/boot.log -n

grep recursively

grep -e Started* /var/log -r