What is the purpose of the Linux 'grep' command? MCQ with Answer and Explanation

What is the purpose of the Linux 'grep' command?
A. Move files
B. Copy files
C. Search for patterns in text
D. List directory contents
Answer: Option C
Solution (By JKSSB Mock Tests)
grep (global regular expression print) searches for lines matching a pattern in files or input.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Operating Systems Questions

Question #1
In Windows, the 'Registry' has five root keys. Which one contains information about the current hardware configuration?
A. HKEY_CURRENT_CONFIG
B. HKEY_CLASSES_ROOT
C. HKEY_CURRENT_USER
D. HKEY_LOCAL_MACHINE\HARDWARE

Correct Answer: Option A


Explanation:
HKEY_CURRENT_CONFIG (HKCC) stores information about the current hardware profile; HKLM\HARDWARE also contains hardware info.

This question belongs to: Computer Operating Systems
Question #2
Which file allocation table structure uses an index block to store pointers to all distinct file data sectors, allowing efficient random access without fragmentation bottlenecks?
A. Contiguous Method
B. Indexed Allocation
C. Linked Method
D. Linear Block Mapping

Correct Answer: Option B


Explanation:
Indexed allocation consolidates all block pointers into a single dedicated index block, enabling direct access to any block without linear scanning.

This question belongs to: Computer Operating Systems
Question #3
Which CPU scheduling algorithm can potentially lead to 'Starvation' where long processes are indefinitely delayed because shorter tasks keep arriving?
A. Round Robin (RR)
B. Shortest Job First (SJF)
C. Uniform Multi-Level Queue
D. First-Come, First-Served (FCFS)

Correct Answer: Option B


Explanation:
Shortest Job First scheduling can starve longer processes if a continuous stream of shorter tasks keeps getting prioritized by the scheduler.

This question belongs to: Computer Operating Systems