Open In App

GATE | Gate IT 2005 | Question 18

Like Article
Like
Save
Share
Report

The shell command

find -name passwd -print

is executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?

 
(A) ls passwd
(B) cat passwd
(C) grep name passwd
(D) grep print passwd


Answer: (C)

Explanation:
Find is a Unix (or Linux) command used for searching the files in a directory hierarchy. The syntax of find command is :

find –name “filename” –print

Grep is a unix command which can be used to find file names with a watching string. The syntax of grep command is :

grep name “filename”

 
Thus, option (C) is correct.

 
Please comment below if you find anything wrong in the above post.


Quiz of this Question


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads