Рубрики
Bash Linux

find

Find files in current catalog with text «sometext»:
find -type f -exec grep -q sometext {} \; -print

Find all files in all subdirectories and execute script/command:
find . -type d -print0 | xargs -0 -L1 sh -c 'cd "$0" && pwd && ./script.sh unpack'

Find all files in the current folder that are less than 1 kilobyte and delete them:
find . -type 'f' -size -1k -delete

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.