You can search word in file using grep command in Linux.
Syntax:
grep [options] <pattern> <file(s)>
Examples with different options:
1. grep anil file1
2. To search exact word in file
grep -w ‘anil’ file2
3. To search words in multiple files or in directory
grep -r ‘anil’ /tmp
4. Case insensitive search
grep -i “Anil’ file3
Note: If you want to discard errors during above commands execution, then redirect errors in /dev/null using below command [/dev/null is the device where anything you send simply disappears].
$ grep -w ‘anil’ /tmp/ 2> /dev/null
The sort command is used to sort the contents of a file. You can sort the data in a text Read more
sed, short for "stream editor", allows you to filter and transform text. A stream editor is used to perform basic Read more
Cron is the system process that will automatically perform tasks for you according to a set schedule. The schedule is Read more
To extract archive file in Linux, you can use the tar command, used for extracting content from the archive files. "tar" Read more