Find regular files with a .conf name below the current directory.
find . -type f -name '*.conf'Search a directory tree by name, type, age, and other conditions.
find [STARTING-POINT...] [EXPRESSION]Find regular files with a .conf name below the current directory.
find . -type f -name '*.conf'Find files modified within the last seven 24-hour periods.
find /var/log -type f -mtime -7| Option / clause | Description |
|---|---|
-name PATTERN | Match a filename pattern (case-sensitive). |
-iname PATTERN | Match a filename pattern without case sensitivity. |
-type TYPE | Match a type such as f (file), d (directory) or l (symlink). |
-maxdepth N | Descend at most N directory levels. |
-mtime N | Match by modification age in 24-hour periods. |
-size SIZE | Match files by size, such as +100M or -1k. |
-exec COMMAND {} \; | Run a command for each match; {} represents the path. |
-print0 | Print paths separated by NUL for safe pipelines. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.