Skip to content
Related Articles

Related Articles

GATE | Gate IT 2005 | Question 18

View Discussion
Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
View Discussion
Improve Article
Save Article

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!