Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | Gate IT 2005 | Question 18

Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
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)

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
Related Articles

Start Your Coding Journey Now!