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 |
What are filter commands in unix?
how will you login one server's shell prompt to an another server?
5 Answers Cosmic Infotech, Perot Systems,
29. How to display top 10 users Who | head -10 | wc –w
How do you remove a directory?
What command will bring user back to their home directory in UNIX?
what is the difference between SED and GREP ? Which one is more better and why?
What is updatedb?
distinguish between paging and swapping?
Which mode is used for allowing file write,read and append mode?
How to view the hidden files in /etc directory?
How can you see the command line history?
Give two UNIX kernel parameters that effect an Oracle install