grep command do in Linux?grep searches for text patterns in files or input and shows the matching lines.
apple in a file named fruits.txt using grep?Use grep apple fruits.txt. This shows all lines containing apple in the file.
grep to ignore case when searching?Use -i option. For example, grep -i apple fruits.txt finds apple, Apple, or APPLE.
grep?Use the -c option. For example, grep -c apple fruits.txt shows how many lines contain apple.
-r option do in grep?-r makes grep search recursively inside all files in a directory and its subdirectories.
grep dog pets.txt searches for 'dog' in the file 'pets.txt'.
grep ignore uppercase or lowercase differences?The -i option makes grep ignore case differences.
grep -c error logfile.txt do?-c counts how many lines contain the pattern.
grep search inside all files in folders and subfolders?-r means recursive search through directories.
grep -v apple fruits.txt do?-v shows lines that do NOT match the pattern.
grep to find a word in a file and ignore case differences.grep.