Discussion
Which of the following Linux commands is/are used to search content from files?
Commands:
i) grep
ii) egrep
iii) fgrep
iv) find
v) tail
vi) tr
Answer: A
The commands that search content from files are grep, egrep and fgrep, so i, ii and iii only. All three look for text patterns inside files. The command find searches for files by name or other attributes and not by what is inside them, tail prints the last lines of a file, and tr translates or deletes characters from its input. So the options with find, tail or tr are wrong. For example, grep pattern file prints the lines of the file that contain the pattern, and egrep and fgrep are variants for extended expressions and for fixed strings.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development