Skip to content
Related Articles

Related Articles

Improve Article

GATE | Gate IT 2005 | Question 18

  • Last Updated : 28 Jun, 2021

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

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :