Sunday, July 25, 2004

touch and find

To create a file dated 4 p.m., March 20, give the command:

% touch -t 03201600 /tmp/4pmyesterday

Then to find the files created after this:

% find . -newer /tmp/4pmyesterday -print

For files created between 10:46 a.m. on July 3, 1999 and 9:37 p.m. on June 4, 2001:

% touch -t 199907031046 /tmp/file1
% touch -t 200106042137 /tmp/file2
% find . -newer /tmp/file1 \! -newer /tmp/file2 -print
% rm /tmp/file[12]

0 Comments:

Post a Comment

<< Home