FREQUENTLY ASKED QUESTIONS (Linux Commands)
Q. How to search a word in a file or in multiple files in Linux using commands ?
You can use Grep command to search or find a given text word in a file or more than one files at once. Grep command will search the given text in the whole file and print the output.
Example:
To search the word "Amazing" in a file
[root@server ~]# grep Amazing sample.txt
The above grep command will search for the word "Amazing" in the file sample.txt
Q. How to search a word in a file or in multiple files in Linux using commands ?
You can use Grep command to search or find a given text word in a file or more than one files at once. Grep command will search the given text in the whole file and print the output.
Example:
To search the word "Amazing" in a file
[root@server ~]# grep Amazing sample.txt
The above grep command will search for the word "Amazing" in the file sample.txt
Search case sensitive
[root@server ~]# grep -i Amazing sample.txt
0 comments:
Post a Comment