PrepAway - Latest Free Exam Questions & Answers

What will this command do?

You work as a Network Administrator for Tech Perfect Inc. The company has a Linux-based
network.
You run the following command on the terminal: find -name “*.conf” -exec cp {} {} .orig \ ;
What will this command do?

PrepAway - Latest Free Exam Questions & Answers

A.
It will extract the content of configuration files from the current directory.

B.
It will search configuration files from the current directory and a .orig extension.

C.
It will back up configuration files from the current directory and a .orig extension.

D.
It will fix other-writable files in your home directory.

Explanation:

When you will execute find -name “*.conf” -exec cp {} {} .orig \ ; command on the terminal, it will
back up configuration files from the current directory and a .orig extension.
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 B and A are incorrect. These options are invalid.
Answer option D is incorrect. To fix other-writable files in your home directory, you will run find ~ -perm -002 -exec chmod o-w {} \;.


Leave a Reply