gns_ua: (Default)
[personal profile] gns_ua
Когда просят найти файлы, изменённые "25 февраля между 14:30 и 15:00" - чем вы это делаете?

Я бы сделал два тача:

touch -t 201002251430 /tmp/tstart && touch -t 201002251500 /tmp/tend

, а потом хладнокровно сказал бы

find /path/to -newer /tmp/tstart -and -not -newer /tmp/tend

, да вот беда - аиксовый find не умеет -not. поэтому делаем так:

find /path/to -newer /tmp/tstart > /tmp/list14
find /path/to -newer /tmp/tend > /tmp/list15

diff /tmp/list14 /tmp/list15 | grep '^<' | cut -c 3- | xargs -I{} cp "{}" /path/where/to/store/them


ЗЫ. нет, mtime/ctime не поможет. Нет, cmin тоже не поможет.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

Profile

gns_ua: (Default)
gns_ua

April 2017

M T W T F S S
     12
3456789
10111213141516
17181920212223
24252627282930

Expand Cut Tags

No cut tags