find, grep
Поиск с копированием:
find /home/shantanu/processed/ -name '*2011*.xml' -exec cp {} /home/shantanu/tosend \;
или
find /home/shantanu/processed/ -name '*2011*.xml' | xargs cp -t /home/shantanu/tosend
http://stackoverflow.com/questions/5241625/find-and-copy-files
Если в именах есть пробелы используем xargs с опцией:
-d '\n'
Поиск за определенную дату:
find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -print
Поиск файлов старше 5 дней:
find /opt/atlassian/jira/logs -type f -mtime +5
Поиск пустых файлов:
find /opt/atlassian/jira/logs -type f -size 0
Поиск бинарных файлов:
find . -type f -exec grep -IL . "{}" \; > ../binary-files
https://code-examples.net/ru/q/1c264b8
Удалить все файлы в директории
find dir_name -mindepth 1 -delete
find . -name "*.doc"|while read i;do catdoc "$i"|grep -H --label="$i" -n "Андерсен";done
http://blog.dander.ru/2010/04/linux.html
find /usr/include/ -type f -print0 | xargs -0 grep 'PIPE_BUF'
find . -name "*.xls"|while read i;do xls2csv "$i"|grep -H --label="$i" -n "Андерсен";done