What is the syntax of grep command and what is its use?
Answers were Sorted based on User's Feedback
Answer / bharath
grep command is used to search a file for keywords.
grep 'keyword' file
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / amit
grep command is used to search the any word, any sentence
from given or input file.
syntex of grep command is
grep "word or sentence" filename
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / ankita
grep is used to find the patterns inside files.
grep -options "pattern" file_name
grep -i "hello" test_file
this is search for "hello"(case doesn't matter as we have used -i) in test_file
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shilpa
syntax= % grep pattern file-name-1 file-name-2
It is used to search files
| Is This Answer Correct ? | 0 Yes | 1 No |
Explain command to view process running?
what does the 'tee' command do?
what are the different hardwares available?
Give the command to display space usage on the UNIX file system.
How to know a process is a zombie or orphan process?
What is pid?
What are filter commands in unix?
How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazement in some of the line.But i want to replace only 'amaze' with delight but don't wanna replace amazed or amazement. thanks
6 Answers Polaris, Tech Mahindra,
Why is awk called awk?
what is the command to print last 8 lines of any text file.
what is the command to list all files in a directory, including the hidden files in UNIX ?
How to open a Database using Unix Command Please Do Reply