Brooks Computing Systems - Jacksonville
Visit Brooks Computing Systems
Mainframes, Desktops & Web Sites
The `find` command is a powerful utility in Gentoo Linux (and Unix-like systems) for searching files and directories bas
The `find` command is a powerful utility in Gentoo Linux (and Unix-like systems) for searching files and directories based on various criteria. Below is a structured explanation of its usage, options, and common examples:
---
find [path...] [expression]- **`path`**: Directories to start the search (e.g., `/`, `.` for the current directory).
- **`expression`**: Criteria to match files (required unless using `-print`).
---
- `-name pattern`: Match filenames (case-sensitive).
find /home -name "*.txt"- `-iname pattern`: Case-insensitive name match.
find /home -iname "*.txt"- `-type f`: Files.
- `-type d`: Directories.
- `-type l`: Symbolic links.
find /usr -type d -name "portage"- `-newer file`: Files newer than `file`.
- `-mtime n`: Modification time within `n` days (e.g., `-mtime 7` for 7 days).
find /var/log -mtime 0 # Files modified today- `-size size`: Match size in units (e.g., `+100k` for >100 KB).
find / -size 1M # Files exactly 1 MB- `-perm mode`: Match exact permissions (e.g., `-perm 755`).
find /opt -perm 600 # Files with owner-only read accessQuality, Reliability & Service Consultancy for Mainframes, Desktops & Web Sites