Which of the following commands will you use to accomplish the task?

You work as a Network Administrator for company.com Inc. The company has Linux-based
network.
You want to search for files anywhere on the system that end in .txt. Which of the following
commands will you use to accomplish the task?

You work as a Network Administrator for company.com Inc. The company has Linux-based
network.
You want to search for files anywhere on the system that end in .txt. Which of the following
commands will you use to accomplish the task?

A.
find /etc -name *.txt

B.
find /etc -name *.txt*

C.
find /etc -name *txt

D.
find /etc name *.txt

Explanation:

find /etc -name *.txt command is used to search for files anywhere on the system that end in .txt.
What is the find command?
The find command can perform a search based on a variety of search limitations. It searches
through one or more directory tree(s) of a filesystem, locating files based on some user-specified
criteria. By default, find returns all files in the current working directory. Further, find allows a user
to specify an action to be taken on each matched file.
Thus, it is an extremely powerful command for applying actions to many files.
The find command can be used with a wild card (*), but it works best when we know the name of
the file or directory we are looking for.
The find command can search your system for files that comply with certain numeric criteria, such
as the size of the file (- size), the number of links to the file (-links), the date of the last change to
the files data (-mtime), or the date of the last time the file was read (-atime). All these criteria
accept a numeric value. When a numeric value is provided to find, it looks for an exact match,
more than the number, or less than the number.
Answer options D, B, and C are incorrect. There is no such commands in the Linux.



Leave a Reply 0

Your email address will not be published. Required fields are marked *