Lab 13: The Find Command
Objective Focus
- Understand and use essential tools
- Not listed as an official of objective, but very important!
Official RHCSA EX200 Exam Objectives
The find command
The find command is not explicitly written in the EX200 objectives but it is talked about in every book related to Linux administration, including RHCSA related ones.
So, I have decided to include a page for it.
| find | path | search option | action |
|---|---|---|---|
| Command | Where to search | by name, size, permissions, etc. | a command to be executed on matches |
| /, /etc,/var/log | File name: -name, -iname | -exec cmd {}; | |
| UID and GID: -user, -group | - ok cmd {}; | ||
| Permission: -perm | delete | ||
| Inode: -inum | |||
| Size and type: -size, -type |
Lets run a few examples of the find command as the root user.
Using -exec and -ok
The -exec and -ok option is how we perform an action on the matches found through the first portion of the find command.
The difference between -exec and -ok, is that -ok will prompt you to confirm the action.
That is all for the find command. There are many options to use with this command. I encourage you to pull up the man page and try some options not mentioned above.