3,183 views
7 votes
7 votes

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?

  1. ls passwd
  2. cat passwd
  3. grep name passwd
  4. grep print passwd

2 Answers

7 votes
7 votes
The closest answer is A. However, all of them are wrong.

the find command in this format prints the files that have the name "passwd" in the current directory and in all the subdirectories. Towards this behavior, `ls` command is the only one with a similar output, but it prints the file with the name `passwd` from the current directory only and not from its subdirectories.

Rest of the commands given are concerned with the content of the file "passwd".
–1 votes
–1 votes
option C
Answer:

Related questions