[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to grep without changing timestamps?



On Sun, Dec 31, 2000 at 02:04:57PM -0500, Maciej Kalisiak wrote:
> Hello all,
> 
> Is it possible to grep a ton of files without modifying their date/timestamps?
> Currently if I use grep, it changes the access time of all files touched,
> which causes mutt to lose track of the folders which have new mail (I guess it
> looks at the timestamp last modified and last accessed to figure this out).
> Occasionally I do want to include the mail folders in my greps, so bypassing
> the "mail" directory is not a solution.

whoa. isn't there a difference between MODIFIED and ACCESSED?
doing "pager < file" should modify the ACCESSED timestamp,
but not the MODIFIED timestamp, right? or am i in the wrong
universe?

% ls -lt edits.sql
-rw-r--r--    1 will     serensof     1280 Dec 28 22:23 edits.sql
% ls -lu edits.sql
-rw-r--r--    1 will     serensof     1280 Dec 28 23:06 edits.sql
% grep xyz edits.sql
% ls -lt edits.sql
-rw-r--r--    1 will     serensof     1280 Dec 28 22:23 edits.sql
% ls -lu edits.sql
-rw-r--r--    1 will     serensof     1280 Jan  2 02:12 edits.sql
%

look under "man ls" for "-t" and for "-u" (and if you're
bored and can figure out what 'file status information'
pertains to, "-c").

-- 
See, if you were allowed to keep the money, you wouldn't
create jobs with it. You'd throw it in the bushes or
something.  But the government will spend it, thereby
creating jobs.      -- Dave Barry

will@serensoft.com    ***    http://www.dontUthink.com/

volunteer to document your experience for next week's
newbies -- http://www.eGroups.com/messages/newbieDoc



Reply to: