Online Linux Terminal Logo
OnlineLinuxTerminal
Операции с файламиCLI Manual

$find

Поиск файлов и директорий в иерархии каталогов по имени, типу, размеру или дате изменения.

Синтаксис командыPOSIX Standard
find [PATH] [OPTIONS] [EXPRESSION]
Сообщество Linux2.4k Онлайн

Общайтесь с пользователями Linux, учите команды и скачивайте шпаргалки.

Попробуйте в интерактивной песочнице

Клиентская симуляция без установки с мгновенным результатом.

Открыть в полноэкранном терминале ↗
bash — terminal

Обзор и принцип работы

Команда find — одна из самых мощных утилит в Linux. Она выполняет рекурсивный поиск файлов в реальном времени по маскам имен, правам доступа, типам файлов и времени модификации.

Основные флаги и параметры команды

Flag / OptionDescription
-name [pattern]Search for files matching the specified filename or wildcard pattern (case-sensitive).
-iname [pattern]Search for files matching the pattern ignoring case distinctions.
-type [f|d|l]Filter results by file type: f (regular file), d (directory), l (symbolic link).
-size [+|-][n]Search by file size: +10M (larger than 10MB), -1k (smaller than 1KB).
-mtime [n]Find files modified n*24 hours ago (+7 for older than a week, -1 for last 24h).
-exec [cmd] {} \;Execute a specific shell command on each matching file found.

Практические примеры использования

#1Find files by exact name or extension
find /var/log -name "*.log"

Recursively scans the /var/log directory for all files ending with the .log extension.

#2Find all directories in the home folder
find /home/user -type d

Filters and outputs only directory paths inside the user home folder.

#3Find files modified in the last 24 hours
find . -type f -mtime -1

Locates recently created or modified files in the current working directory.