What is the name of the specialized Linux command used to search for a specific text string or pattern within files? MCQ with Answer and Explanation

What is the name of the specialized Linux command used to search for a specific text string or pattern within files?
A. cat
B. find
C. locate
D. grep
Answer: Option D
Solution (By JKSSB Mock Tests)
The 'grep' command (Global Regular Expression Print) searches through files for lines matching a specified text pattern and prints them.

Discuss this Question (0)

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

Practice More Operating Systems Questions

Question #1
What is the purpose of the Android 'SensorEvent' class?
A. To register listeners
B. To manage sensors
C. To calibrate sensors
D. To hold data from sensor readings (values, accuracy, timestamp)

Correct Answer: Option D


Explanation:
SensorEvent is used in sensor callbacks to provide the sensor data values and metadata.

This question belongs to: Computer Operating Systems
Question #2
In Linux, the file /etc/passwd contains:
A. System hostname
B. Encrypted passwords
C. User account information
D. Group information

Correct Answer: Option C


Explanation:
/etc/passwd stores user account data such as username, UID, home directory, and shell; passwords are stored separately in /etc/shadow.

This question belongs to: Computer Operating Systems
Question #3
In Linux, the 'df' command with '-h' option shows:
A. File system type
B. Disk space usage in human-readable format
C. Mount options
D. Inode usage

Correct Answer: Option B


Explanation:
df -h displays file system usage in GB/MB, making it easier to read.

This question belongs to: Computer Operating Systems